Skip to content

Commit a370cb2

Browse files
authored
Rust: Bump to 1.81.0 (#6943)
1 parent 7d2cb96 commit a370cb2

File tree

7 files changed

+64
-58
lines changed

7 files changed

+64
-58
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. Line numbers will certainly change, so don't forget to run WRITEME - `./.tools/readmes/.venv/bin/python ./.tools/readmes/writeme.py --languages Rust:1`.
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/README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,30 @@ Code examples that show you how to perform the essential operations within a ser
4545

4646
Code excerpts that show you how to call individual service functions.
4747

48-
- [AttachRolePolicy](src/iam-service-lib.rs#L221)
49-
- [AttachUserPolicy](src/iam-service-lib.rs#L236)
50-
- [CreateAccessKey](src/iam-service-lib.rs#L270)
48+
- [AttachRolePolicy](src/iam-service-lib.rs#L190)
49+
- [AttachUserPolicy](src/iam-service-lib.rs#L205)
50+
- [CreateAccessKey](src/iam-service-lib.rs#L239)
5151
- [CreatePolicy](src/iam-service-lib.rs#L18)
52-
- [CreateRole](src/iam-service-lib.rs#L65)
53-
- [CreateServiceLinkedRole](src/iam-service-lib.rs#L417)
54-
- [CreateUser](src/iam-service-lib.rs#L87)
55-
- [DeleteAccessKey](src/iam-service-lib.rs#L294)
56-
- [DeletePolicy](src/iam-service-lib.rs#L338)
57-
- [DeleteRole](src/iam-service-lib.rs#L160)
58-
- [DeleteServiceLinkedRole](src/iam-service-lib.rs#L176)
59-
- [DeleteUser](src/iam-service-lib.rs#L191)
60-
- [DeleteUserPolicy](src/iam-service-lib.rs#L349)
61-
- [DetachRolePolicy](src/iam-service-lib.rs#L321)
62-
- [DetachUserPolicy](src/iam-service-lib.rs#L253)
63-
- [GetAccountPasswordPolicy](src/iam-service-lib.rs#L436)
64-
- [GetRole](src/iam-service-lib.rs#L113)
65-
- [ListAttachedRolePolicies](src/iam-service-lib.rs#L446)
66-
- [ListGroups](src/iam-service-lib.rs#L398)
67-
- [ListPolicies](src/iam-service-lib.rs#L366)
68-
- [ListRolePolicies](src/iam-service-lib.rs#L467)
69-
- [ListRoles](src/iam-service-lib.rs#L95)
70-
- [ListSAMLProviders](src/iam-service-lib.rs#L486)
71-
- [ListUsers](src/iam-service-lib.rs#L123)
52+
- [CreateRole](src/iam-service-lib.rs#L34)
53+
- [CreateServiceLinkedRole](src/iam-service-lib.rs#L386)
54+
- [CreateUser](src/iam-service-lib.rs#L56)
55+
- [DeleteAccessKey](src/iam-service-lib.rs#L263)
56+
- [DeletePolicy](src/iam-service-lib.rs#L307)
57+
- [DeleteRole](src/iam-service-lib.rs#L129)
58+
- [DeleteServiceLinkedRole](src/iam-service-lib.rs#L145)
59+
- [DeleteUser](src/iam-service-lib.rs#L160)
60+
- [DeleteUserPolicy](src/iam-service-lib.rs#L318)
61+
- [DetachRolePolicy](src/iam-service-lib.rs#L290)
62+
- [DetachUserPolicy](src/iam-service-lib.rs#L222)
63+
- [GetAccountPasswordPolicy](src/iam-service-lib.rs#L405)
64+
- [GetRole](src/iam-service-lib.rs#L82)
65+
- [ListAttachedRolePolicies](src/iam-service-lib.rs#L415)
66+
- [ListGroups](src/iam-service-lib.rs#L367)
67+
- [ListPolicies](src/iam-service-lib.rs#L335)
68+
- [ListRolePolicies](src/iam-service-lib.rs#L436)
69+
- [ListRoles](src/iam-service-lib.rs#L64)
70+
- [ListSAMLProviders](src/iam-service-lib.rs#L455)
71+
- [ListUsers](src/iam-service-lib.rs#L92)
7272

7373

7474
<!--custom.examples.start-->

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

Lines changed: 33 additions & 31 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,37 @@ pub async fn list_saml_providers(
493462
}
494463
// snippet-end:[rust.example_code.iam.service.list_saml_providers]
495464

465+
// snippet-start:[rust.example_code.iam.service.create_policy.test]
466+
#[cfg(test)]
467+
mod test_create_policy {
468+
use crate::create_policy;
469+
use http::StatusCode;
470+
use sdk_examples_test_utils::single_shot_client;
471+
472+
#[tokio::test]
473+
async fn test_create_policy_success() {
474+
let client = single_shot_client!(
475+
sdk: aws_sdk_iam,
476+
status: StatusCode::OK,
477+
response: include_str!("../testing/test_create_policy_response_success.xml")
478+
);
479+
480+
let response = create_policy(&client, "{}", "test_role").await;
481+
assert!(response.is_ok());
482+
}
483+
484+
#[tokio::test]
485+
async fn test_create_policy_failed() {
486+
let client = single_shot_client!(
487+
sdk: aws_sdk_iam,
488+
status: StatusCode::BAD_REQUEST,
489+
response: include_str!("../testing/test_create_policy_response_malformed.xml")
490+
);
491+
492+
let response = create_policy(&client, "{}", "test_role").await;
493+
assert!(response.is_err());
494+
}
495+
}
496+
// snippet-end:[rust.example_code.iam.service.create_policy.test]
497+
496498
// snippet-end:[rust.example_code.iam.scenario_getting_started.lib]

rustv1/examples/rust-toolchain.toml

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)