Commit b7eda18b authored by Nugine's avatar Nugine
Browse files

fix(s3s): lints

parent b7714bfa
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -212,7 +212,9 @@ where
                };

                let mut fields = mem::take(fields);
                fields.iter_mut().for_each(|x| x.0.make_ascii_lowercase());
                for x in &mut fields {
                    x.0.make_ascii_lowercase();
                }
                fields.sort_by(|lhs, rhs| lhs.0.as_str().cmp(rhs.0.as_str()));

                return Ok(Ok(Multipart { fields, file }));
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ impl S3Path {
}

/// See [bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html)
#[allow(clippy::manual_is_variant_and)] // FIXME: https://github.com/rust-lang/rust-clippy/issues/15202
#[must_use]
pub fn check_bucket_name(name: &str) -> bool {
    if !(3_usize..64).contains(&name.len()) {
+3 −1
Original line number Diff line number Diff line
@@ -67,7 +67,9 @@ fn sha256_chunk(chunk: &[Bytes]) -> impl AsRef<[u8; 32]> + use<> {
fn sha256_chunk(chunk: &[Bytes]) -> impl AsRef<[u8]> {
    use openssl::hash::{Hasher, MessageDigest};
    let mut h = Hasher::new(MessageDigest::sha256()).unwrap();
    chunk.iter().for_each(|data| h.update(data).unwrap());
    for data in chunk {
        h.update(data).unwrap();
    }
    h.finish().unwrap()
}