Skip to content

Commit

Permalink
Fix compile warnings for 1.81.0 MSRV bump
Browse files Browse the repository at this point in the history
  • Loading branch information
landonxjames committed Dec 5, 2024
1 parent 6f01d22 commit df091eb
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion aws/rust-runtime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions aws/rust-runtime/aws-config/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions aws/rust-runtime/aws-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ default = ["client-hyper", "rustls", "rt-tokio", "credentials-process", "sso"]
rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-runtime/rt-tokio", "tokio/rt"]
rustls = ["aws-smithy-runtime/tls-rustls", "client-hyper"]
sso = ["dep:aws-sdk-sso", "dep:aws-sdk-ssooidc", "dep:ring", "dep:hex", "dep:zeroize", "aws-smithy-runtime-api/http-auth"]
test-util = ["aws-runtime/test-util"]

# deprecated: this feature does nothing
allow-compilation = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ mod test {
#[cfg(all(feature = "sso", not(windows)))]
make_test!(sso_no_token_file);

#[cfg(feature = "credentials-sso")]
#[cfg(feature = "sso")]
make_test!(e2e_fips_and_dual_stack_sso);

#[tokio::test]
Expand Down
15 changes: 7 additions & 8 deletions aws/rust-runtime/aws-config/src/profile/credentials/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,14 @@ fn credential_process_from_profile(

#[cfg(test)]
mod tests {
use super::{resolve_chain, ProfileChain};
use crate::profile::credentials::repr::BaseProvider;
use crate::sensitive_command::CommandWithSensitiveArgs;
use aws_runtime::env_config::property::Properties;
use aws_runtime::env_config::section::EnvConfigSections;
use serde::Deserialize;
use std::collections::HashMap;

#[cfg(feature = "test-utils")]
#[test]
fn run_test_cases() -> Result<(), Box<dyn std::error::Error>> {
let test_cases: Vec<TestCase> = serde_json::from_str(&std::fs::read_to_string(
Expand All @@ -487,14 +490,13 @@ mod tests {
Ok(())
}

#[cfg(feature = "test-utils")]
#[cfg(feature = "test-util")]
fn check(test_case: TestCase) {
use aws_runtime::profile::profile_set::ProfileSet;
crate::profile::credentials::repr::resolve_chain;
let source = ProfileSet::new(
let source = EnvConfigSections::new(
test_case.input.profiles,
test_case.input.selected_profile,
test_case.input.sso_sessions,
Properties::new(),
);
let actual = resolve_chain(&source);
let expected = test_case.output;
Expand All @@ -515,15 +517,13 @@ mod tests {
}
}

#[cfg(feature = "test-utils")]
#[derive(Deserialize)]
struct TestCase {
docs: String,
input: TestInput,
output: TestOutput,
}

#[cfg(feature = "test-utils")]
#[derive(Deserialize)]
struct TestInput {
profiles: HashMap<String, HashMap<String, String>>,
Expand All @@ -532,7 +532,6 @@ mod tests {
sso_sessions: HashMap<String, HashMap<String, String>>,
}

#[cfg(feature = "test-utils")]
fn to_test_output(profile_chain: ProfileChain<'_>) -> Vec<Provider> {
let mut output = vec![];
match profile_chain.base {
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-runtime/src/env_config/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl EnvConfigSections {
/// Create a new Profile set directly from a HashMap
///
/// This method creates a ProfileSet directly from a hashmap with no normalization for test purposes.
#[cfg(test)]
#[cfg(any(test, feature = "test-util"))]
pub fn new(
profiles: HashMap<String, HashMap<String, String>>,
selected_profile: impl Into<Cow<'static, str>>,
Expand Down
6 changes: 3 additions & 3 deletions rust-runtime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-smithy-runtime"
version = "1.7.4"
version = "1.7.5"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Zelda Hessler <zhessler@amazon.com>"]
description = "The new smithy runtime crate"
edition = "2021"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl ReplayingClient {
.await;
body_comparer(expected.body().as_ref(), actual.body().as_ref())?;
let actual: HttpRequest = actual.map(SdkBody::from).try_into()?;
aws_smithy_protocol_test::assert_uris_match(&expected.uri().to_string(), actual.uri());
aws_smithy_protocol_test::assert_uris_match(expected.uri().to_string(), actual.uri());
let expected_headers = expected
.headers()
.keys()
Expand Down
2 changes: 2 additions & 0 deletions tools/ci-build/sdk-lints/src/changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ impl Check for ChangelogNext {
}
}

#[allow(dead_code)]
pub(crate) struct DotChangelog;

impl Lint for DotChangelog {
Expand All @@ -56,6 +57,7 @@ impl Check for DotChangelog {
}

/// Validate that changelog entries in the `.changelog` directory follows best practices
#[allow(dead_code)]
fn check_changelog_next(path: impl AsRef<Path> + Debug) -> std::result::Result<(), Vec<LintError>> {
let parsed = ChangelogLoader::default()
.load_from_dir(path)
Expand Down

0 comments on commit df091eb

Please sign in to comment.