From 57e76753f562ac408fb8d890bfd54121a1dc5e1c Mon Sep 17 00:00:00 2001 From: Radical Date: Wed, 25 Jun 2025 14:09:18 +0200 Subject: [PATCH] style: cargo fmt --- src/bunny/mod.rs | 4 +--- src/edge_storage/endpoint.rs | 2 +- src/edge_storage/mod.rs | 24 ++++++++++++++---------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/bunny/mod.rs b/src/bunny/mod.rs index 3a373bc..7146d57 100644 --- a/src/bunny/mod.rs +++ b/src/bunny/mod.rs @@ -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 diff --git a/src/edge_storage/endpoint.rs b/src/edge_storage/endpoint.rs index 555c0cc..42b522b 100644 --- a/src/edge_storage/endpoint.rs +++ b/src/edge_storage/endpoint.rs @@ -1,5 +1,5 @@ -use url::Url; use crate::error::Error; +use url::Url; /// Endpoints for Edge Storage API #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/src/edge_storage/mod.rs b/src/edge_storage/mod.rs index adcd2c4..c3147ba 100644 --- a/src/edge_storage/mod.rs +++ b/src/edge_storage/mod.rs @@ -1,10 +1,13 @@ //! Edge Storage API -//! +//! //! Contains enums, structs and functions for the Bunny Edge Storage API 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, T1: AsRef>(api_key: T, endpoint: Endpoint, storage_zone: T1) -> Result { + pub async fn new, T1: AsRef>( + api_key: T, + endpoint: Endpoint, + storage_zone: T1, + ) -> Result { 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 @@ -96,7 +100,7 @@ impl<'a> EdgeStorageClient { /// #[tokio::main] /// async fn main() -> Result<(), Error> { /// let mut client = EdgeStorageClient::new("storage_zone_api_key", Endpoint::Frankfurt, "MyStorageZone").await?; - /// + /// /// // Will download the file STORAGE_ZONE/images/file.png /// let contents = client.download("/images/file.png").await?; /// @@ -131,7 +135,7 @@ impl<'a> EdgeStorageClient { /// #[tokio::main] /// async fn main() -> Result<(), Error> { /// let mut client = EdgeStorageClient::new("storage_zone_api_key", Endpoint::Frankfurt, "MyStorageZone").await?; - /// + /// /// // Will delete the file STORAGE_ZONE/images/file.png /// client.delete("/images/file.png").await?; /// @@ -162,7 +166,7 @@ impl<'a> EdgeStorageClient { /// #[tokio::main] /// async fn main() -> Result<(), Error> { /// let mut client = EdgeStorageClient::new("storage_zone_api_key", Endpoint::Frankfurt, "MyStorageZone").await?; - /// + /// /// // Will list the files in STORAGE_ZONE/images/ /// let files = client.list("/images/").await?; ///