Skip to content

Commit 6a9236b

Browse files
committed
Rust: Bump to 1.81.0
1 parent 4ed9b71 commit 6a9236b

File tree

6 files changed

+43
-36
lines changed

6 files changed

+43
-36
lines changed

.github/workflows/lint-rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: dtolnay/rust-toolchain@stable
2828
if: steps.changed-files.outputs.any_changed == 'true'
2929
with:
30-
toolchain: "1.80.1"
30+
toolchain: "1.81.0"
3131
components: clippy, rustfmt
3232
- name: Set Environment
3333
if: steps.changed-files.outputs.any_changed == 'true'

rustv1/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ hosted on [Amazon Elastic Container Registry (ECR)](https://docs.aws.amazon.com/
9696
with all Rust examples with dependencies pre-resolved, allowing you to explore
9797
these examples in an isolated environment.
9898

99+
## Updating Rust Version
100+
101+
If a rust version releases (most likely) a clippy or has some other breaking change, the Weathertop dashboard will go red. The easiest way to handle this is to run `./tools/set_rust_version.py [rust_version]` (using a venv with the appropriate requirements), creating a commit with those updates, and then running `cargo clippy --fix` in the appropriate folder before making a second commit with those fixes.
102+
99103
## Contributing
100104

101105
When adding or modifying Rust code examples, follow common Rust best practices.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# This should be kept in sync with https://github.com/awslabs/aws-sdk-rust#supported-rust-versions-msrv
22
[toolchain]
3-
channel = "1.80.1"
3+
channel = "1.81.0"

rustv1/examples/aurora/src/aurora_scenario/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ async fn test_scenario_clean_up_errors() {
952952
assert!(clean_up.is_err());
953953
let errs = clean_up.unwrap_err();
954954
assert_eq!(errs.len(), 2);
955-
assert_matches!(errs.get(0), Some(ScenarioError {message, context: _}) if message == "Failed to check instance state during deletion");
955+
assert_matches!(errs.first(), Some(ScenarioError {message, context: _}) if message == "Failed to check instance state during deletion");
956956
assert_matches!(errs.get(1), Some(ScenarioError {message, context: _}) if message == "Failed to check cluster state during deletion");
957957
});
958958

rustv1/examples/iam/src/iam-service-lib.rs

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,37 +31,6 @@ pub async fn create_policy(
3131
}
3232
// snippet-end:[rust.example_code.iam.service.create_policy]
3333

34-
#[cfg(test)]
35-
mod test_create_policy {
36-
use crate::create_policy;
37-
use http::StatusCode;
38-
use sdk_examples_test_utils::single_shot_client;
39-
40-
#[tokio::test]
41-
async fn test_create_policy_success() {
42-
let client = single_shot_client!(
43-
sdk: aws_sdk_iam,
44-
status: StatusCode::OK,
45-
response: include_str!("../testing/test_create_policy_response_success.xml")
46-
);
47-
48-
let response = create_policy(&client, "{}", "test_role").await;
49-
assert!(response.is_ok());
50-
}
51-
52-
#[tokio::test]
53-
async fn test_create_policy_failed() {
54-
let client = single_shot_client!(
55-
sdk: aws_sdk_iam,
56-
status: StatusCode::BAD_REQUEST,
57-
response: include_str!("../testing/test_create_policy_response_malformed.xml")
58-
);
59-
60-
let response = create_policy(&client, "{}", "test_role").await;
61-
assert!(response.is_err());
62-
}
63-
}
64-
6534
// snippet-start:[rust.example_code.iam.service.create_role]
6635
pub async fn create_role(
6736
client: &iamClient,
@@ -493,4 +462,38 @@ pub async fn list_saml_providers(
493462
}
494463
// snippet-end:[rust.example_code.iam.service.list_saml_providers]
495464

496-
// snippet-end:[rust.example_code.iam.scenario_getting_started.lib]
465+
466+
// snippet-start:[rust.example_code.iam.service.create_policy.test]
467+
#[cfg(test)]
468+
mod test_create_policy {
469+
use crate::create_policy;
470+
use http::StatusCode;
471+
use sdk_examples_test_utils::single_shot_client;
472+
473+
#[tokio::test]
474+
async fn test_create_policy_success() {
475+
let client = single_shot_client!(
476+
sdk: aws_sdk_iam,
477+
status: StatusCode::OK,
478+
response: include_str!("../testing/test_create_policy_response_success.xml")
479+
);
480+
481+
let response = create_policy(&client, "{}", "test_role").await;
482+
assert!(response.is_ok());
483+
}
484+
485+
#[tokio::test]
486+
async fn test_create_policy_failed() {
487+
let client = single_shot_client!(
488+
sdk: aws_sdk_iam,
489+
status: StatusCode::BAD_REQUEST,
490+
response: include_str!("../testing/test_create_policy_response_malformed.xml")
491+
);
492+
493+
let response = create_policy(&client, "{}", "test_role").await;
494+
assert!(response.is_err());
495+
}
496+
}
497+
// snippet-end:[rust.example_code.iam.service.create_policy.test]
498+
499+
// snippet-end:[rust.example_code.iam.scenario_getting_started.lib]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# This should be kept in sync with https://github.com/awslabs/aws-sdk-rust#supported-rust-versions-msrv
22
[toolchain]
3-
channel = "1.80.1"
3+
channel = "1.81.0"

0 commit comments

Comments
 (0)