From 38bdde86ec6e75c3f51c9de3a7511b2e75d5aaff Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Sun, 29 Dec 2024 10:05:37 +0100 Subject: [PATCH] docs: fix markdown fmt --- src/actions/delete_objects.rs | 1 + src/actions/get_bucket_policy.rs | 2 ++ src/actions/list_objects_v2.rs | 4 ++++ src/actions/multipart_upload/complete.rs | 1 + src/actions/multipart_upload/create.rs | 4 ++++ src/actions/multipart_upload/list_parts.rs | 4 ++++ src/bucket.rs | 4 ++++ src/credentials/rotating.rs | 2 ++ src/credentials/serde.rs | 2 ++ src/map.rs | 2 ++ src/signing/mod.rs | 1 + 11 files changed, 27 insertions(+) diff --git a/src/actions/delete_objects.rs b/src/actions/delete_objects.rs index eac56c9..391c3c6 100644 --- a/src/actions/delete_objects.rs +++ b/src/actions/delete_objects.rs @@ -73,6 +73,7 @@ where /// Generate the XML body for the request. /// /// # Panics + /// /// Panics if an index is not representable as a `u16`. pub fn body_with_md5(self) -> (String, String) { #[derive(Serialize)] diff --git a/src/actions/get_bucket_policy.rs b/src/actions/get_bucket_policy.rs index bf5b7c7..3207e5d 100644 --- a/src/actions/get_bucket_policy.rs +++ b/src/actions/get_bucket_policy.rs @@ -50,7 +50,9 @@ impl<'a> GetBucketPolicy<'a> { } /// Parse the response from S3. + /// /// # Errors + /// /// If the response cannot be parsed. pub fn parse_response(s: &str) -> Result { serde_json::from_str(s) diff --git a/src/actions/list_objects_v2.rs b/src/actions/list_objects_v2.rs index 4543fe0..4174355 100644 --- a/src/actions/list_objects_v2.rs +++ b/src/actions/list_objects_v2.rs @@ -180,7 +180,9 @@ impl<'a> ListObjectsV2<'a> { } /// Parse the XML response from S3 into a struct. + /// /// # Errors + /// /// Returns an error if the XML response could not be parsed. pub fn parse_response( s: impl AsRef<[u8]>, @@ -189,7 +191,9 @@ impl<'a> ListObjectsV2<'a> { } /// Parse the XML response from S3 into a struct. + /// /// # Errors + /// /// Returns an error if the XML response could not be parsed. pub fn parse_response_from_reader( s: impl Read, diff --git a/src/actions/multipart_upload/complete.rs b/src/actions/multipart_upload/complete.rs index 95bf438..c0b6223 100644 --- a/src/actions/multipart_upload/complete.rs +++ b/src/actions/multipart_upload/complete.rs @@ -60,6 +60,7 @@ where /// Generate the XML body for the request. /// /// # Panics + /// /// Panics if an index is not representable as a `u16`. pub fn body(self) -> String { #[derive(Serialize)] diff --git a/src/actions/multipart_upload/create.rs b/src/actions/multipart_upload/create.rs index a217937..4b80a00 100644 --- a/src/actions/multipart_upload/create.rs +++ b/src/actions/multipart_upload/create.rs @@ -63,7 +63,9 @@ impl<'a> CreateMultipartUpload<'a> { } /// Parse the XML response from S3 + /// /// # Errors + /// /// Will return an error if the body is not valid XML pub fn parse_response( s: impl AsRef<[u8]>, @@ -72,7 +74,9 @@ impl<'a> CreateMultipartUpload<'a> { } /// Parse the XML response from S3 + /// /// # Errors + /// /// Will return an error if the body is not valid XML pub fn parse_response_from_reader( s: impl Read, diff --git a/src/actions/multipart_upload/list_parts.rs b/src/actions/multipart_upload/list_parts.rs index 1a6f08b..3abb5a3 100644 --- a/src/actions/multipart_upload/list_parts.rs +++ b/src/actions/multipart_upload/list_parts.rs @@ -88,14 +88,18 @@ impl<'a> ListParts<'a> { } /// Parse the XML response from S3 into a struct + /// /// # Errors + /// /// Will return an error if the XML cannot be deserialized pub fn parse_response(s: impl AsRef<[u8]>) -> Result { Self::parse_response_from_reader(&mut s.as_ref()) } /// Parse the XML response from S3 into a struct + /// /// # Errors + /// /// Will return an error if the XML cannot be deserialized pub fn parse_response_from_reader( s: impl BufRead, diff --git a/src/bucket.rs b/src/bucket.rs index 902b5e2..b48a98b 100644 --- a/src/bucket.rs +++ b/src/bucket.rs @@ -86,7 +86,9 @@ impl From for BucketError { impl Bucket { /// Construct a new S3 bucket + /// /// # Errors + /// /// Returns a `BucketError` if the `endpoint` is not a valid url, or if the `endpoint` is missing the host. pub fn new( endpoint: Url, @@ -135,7 +137,9 @@ impl Bucket { /// /// This is not a signed url, it's just the starting point for /// generating an url to an S3 object. + /// /// # Errors + /// /// Returns a `ParseError` if the object is not a valid path. pub fn object_url(&self, object: &str) -> Result { let object = percent_encode_path(object); diff --git a/src/credentials/rotating.rs b/src/credentials/rotating.rs index 4666e2c..eb86d96 100644 --- a/src/credentials/rotating.rs +++ b/src/credentials/rotating.rs @@ -29,6 +29,7 @@ impl RotatingCredentials { /// Get the latest credentials inside this `RotatingCredentials` /// /// # Panics + /// /// If the lock is poisoned #[must_use] pub fn get(&self) -> Arc { @@ -39,6 +40,7 @@ impl RotatingCredentials { /// Update the credentials inside this `RotatingCredentials` /// /// # Panics + /// /// If the lock is poisoned pub fn update(&self, key: String, secret: String, token: Option) { let credentials = Credentials::new_with_maybe_token(key, secret, token); diff --git a/src/credentials/serde.rs b/src/credentials/serde.rs index ada74a2..dc3bf05 100644 --- a/src/credentials/serde.rs +++ b/src/credentials/serde.rs @@ -36,7 +36,9 @@ impl Ec2SecurityCredentialsMetadataResponse { /// /// Parses the credentials from a response received from /// `http://169.254.169.254/latest/meta-data/iam/security-credentials/{name-of-IAM-role}`. + /// /// # Errors + /// /// Returns an error if the JSON is invalid. pub fn deserialize(s: &str) -> Result { serde_json::from_str(s) diff --git a/src/map.rs b/src/map.rs index 8bd32bd..896b9ac 100644 --- a/src/map.rs +++ b/src/map.rs @@ -50,6 +50,7 @@ impl<'a> Map<'a> { /// ``` /// /// # Panics + /// /// In case of out of bound inner index access pub fn insert(&mut self, key: K, value: V) where @@ -82,6 +83,7 @@ impl<'a> Map<'a> { /// ``` /// /// # Panics + /// /// In case of out of bound inner index access pub fn append(&mut self, key: K, value: V) where diff --git a/src/signing/mod.rs b/src/signing/mod.rs index b4acd66..f6657dc 100644 --- a/src/signing/mod.rs +++ b/src/signing/mod.rs @@ -15,6 +15,7 @@ pub(crate) mod util; /// Sign a URL with AWS Signature. /// /// # Panics +/// /// If date format is invalid. #[allow( clippy::too_many_arguments,