Skip to content

Commit

Permalink
docs: fix markdown fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
paolobarbolini authored and guerinoni committed Dec 31, 2024
1 parent 68565f2 commit 38bdde8
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/actions/delete_objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 2 additions & 0 deletions src/actions/get_bucket_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GetBucketPolicyResponse, serde_json::Error> {
serde_json::from_str(s)
Expand Down
4 changes: 4 additions & 0 deletions src/actions/list_objects_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]>,
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/actions/multipart_upload/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
4 changes: 4 additions & 0 deletions src/actions/multipart_upload/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]>,
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions src/actions/multipart_upload/list_parts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ListPartsResponse, quick_xml::DeError> {
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,
Expand Down
4 changes: 4 additions & 0 deletions src/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ impl From<ParseError> 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,
Expand Down Expand Up @@ -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<Url, ParseError> {
let object = percent_encode_path(object);
Expand Down
2 changes: 2 additions & 0 deletions src/credentials/rotating.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Credentials> {
Expand All @@ -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<String>) {
let credentials = Credentials::new_with_maybe_token(key, secret, token);
Expand Down
2 changes: 2 additions & 0 deletions src/credentials/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self, serde_json::Error> {
serde_json::from_str(s)
Expand Down
2 changes: 2 additions & 0 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl<'a> Map<'a> {
/// ```
///
/// # Panics
///
/// In case of out of bound inner index access
pub fn insert<K, V>(&mut self, key: K, value: V)
where
Expand Down Expand Up @@ -82,6 +83,7 @@ impl<'a> Map<'a> {
/// ```
///
/// # Panics
///
/// In case of out of bound inner index access
pub fn append<K, V>(&mut self, key: K, value: V)
where
Expand Down
1 change: 1 addition & 0 deletions src/signing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 38bdde8

Please sign in to comment.