Commit 69769c4c authored by Nugine's avatar Nugine
Browse files

refactor: fix for edition 2024

parent a7e92251
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -172,10 +172,10 @@ pub fn codegen(model: &smithy::Model) {
            let desc = &err.description[0];
            let status = &err.status[0];

            if let Some(ref desc) = desc {
            if let Some(desc) = desc {
                g!("/// {desc}");
            }
            if let Some(ref status) = status {
            if let Some(status) = status {
                if desc.is_some() {
                    g!("///");
                }
+4 −3
Original line number Diff line number Diff line
@@ -39,9 +39,10 @@ const REGION: &str = "us-west-2";
fn setup_tracing() {
    use tracing_subscriber::EnvFilter;

    if env::var("RUST_LOG").is_err() {
        env::set_var("RUST_LOG", "it_aws=debug,s3s_fs=debug,s3s=debug");
    }
    // if env::var("RUST_LOG").is_err() {
    //     // TODO: Audit that the environment access only happens in single-threaded code.
    //     unsafe { env::set_var("RUST_LOG", "it_aws=debug,s3s_fs=debug,s3s=debug") };
    // }

    tracing_subscriber::fmt()
        .pretty()
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ impl<'a> OrderedHeaders<'a> {
        Ok(Self { headers })
    }

    fn get_all_pairs(&self, name: &str) -> impl Iterator<Item = (&'a str, &'a str)> + '_ {
    fn get_all_pairs(&self, name: &str) -> impl Iterator<Item = (&'a str, &'a str)> + '_ + use<'a, '_> {
        let slice = self.headers.as_slice();

        let lower_bound = slice.partition_point(|x| x.0 < name);
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ impl OrderedQs {
    }

    /// Gets query values by name. Time `O(logn)`
    pub fn get_all(&self, name: &str) -> impl Iterator<Item = &str> {
    pub fn get_all(&self, name: &str) -> impl Iterator<Item = &str> + use<'_> {
        let qs = self.qs.as_slice();

        let lower_bound = qs.partition_point(|x| x.0.as_str() < name);
+2 −2
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ fn hex_bytes32<R>(src: impl AsRef<[u8]>, f: impl FnOnce(&str) -> R) -> R {
}

#[cfg(not(all(feature = "openssl", not(windows))))]
fn sha256(data: &[u8]) -> impl AsRef<[u8; 32]> {
fn sha256(data: &[u8]) -> impl AsRef<[u8; 32]> + use<> {
    use sha2::{Digest, Sha256};
    <Sha256 as Digest>::digest(data)
}
@@ -56,7 +56,7 @@ fn sha256(data: &[u8]) -> impl AsRef<[u8]> {
}

#[cfg(not(all(feature = "openssl", not(windows))))]
fn sha256_chunk(chunk: &[Bytes]) -> impl AsRef<[u8; 32]> {
fn sha256_chunk(chunk: &[Bytes]) -> impl AsRef<[u8; 32]> + use<> {
    use sha2::{Digest, Sha256};
    let mut h = <Sha256 as Digest>::new();
    chunk.iter().for_each(|data| h.update(data));