style: cargo fmt
This commit is contained in:
parent
8412489373
commit
57e76753f5
3 changed files with 16 additions and 14 deletions
|
@ -44,9 +44,7 @@ impl BunnyClient {
|
|||
|
||||
let reqwest = RClient::builder().default_headers(headers).build()?;
|
||||
|
||||
Ok(Self {
|
||||
reqwest,
|
||||
})
|
||||
Ok(Self { reqwest })
|
||||
}
|
||||
|
||||
// TODO: Following functions could probably use better naming, the names are currently derived from the titles on the API reference
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use url::Url;
|
||||
use crate::error::Error;
|
||||
use url::Url;
|
||||
|
||||
/// Endpoints for Edge Storage API
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
|
|
|
@ -4,7 +4,10 @@
|
|||
|
||||
use crate::error::Error;
|
||||
use bytes::Bytes;
|
||||
use reqwest::{header::{HeaderMap, HeaderValue}, Client};
|
||||
use reqwest::{
|
||||
Client,
|
||||
header::{HeaderMap, HeaderValue},
|
||||
};
|
||||
use url::Url;
|
||||
|
||||
mod endpoint;
|
||||
|
@ -32,7 +35,11 @@ impl<'a> EdgeStorageClient {
|
|||
/// Ok(())
|
||||
/// }
|
||||
/// ```
|
||||
pub async fn new<T: AsRef<str>, T1: AsRef<str>>(api_key: T, endpoint: Endpoint, storage_zone: T1) -> Result<Self, Error> {
|
||||
pub async fn new<T: AsRef<str>, T1: AsRef<str>>(
|
||||
api_key: T,
|
||||
endpoint: Endpoint,
|
||||
storage_zone: T1,
|
||||
) -> Result<Self, Error> {
|
||||
let mut headers = HeaderMap::new();
|
||||
headers.append("AccessKey", HeaderValue::from_str(api_key.as_ref())?);
|
||||
headers.append("accept", HeaderValue::from_str("application/json")?);
|
||||
|
@ -44,10 +51,7 @@ impl<'a> EdgeStorageClient {
|
|||
|
||||
let url = endpoint.join(&storage_zone)?;
|
||||
|
||||
Ok(Self {
|
||||
url,
|
||||
reqwest,
|
||||
})
|
||||
Ok(Self { url, reqwest })
|
||||
}
|
||||
|
||||
/// Uploads a file to the Storage Zone
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue