-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update crates to Rust 2021 #1388
Conversation
A new generated diff is ready to view. A new doc preview is ready to view. Rust Wrk benchmark report:Duration: 90 sec, Connections: 32, Threads: 2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There are also some usages of TryFrom
and TryInto
in the runtime. It's weird that Clippy is not making the suggestion to remove the imports, since since #1268 the runtime uses the 2021 edition.
We can remove those in another PR.
➜ SmithyRsSource git:(1332) ✗ rg "TryFrom|TryInto"
rust-runtime/inlineable/src/ec2_query_errors.rs
7:use std::convert::TryFrom;
75: use std::convert::TryFrom;
rust-runtime/inlineable/src/rest_xml_wrapped_errors.rs
7:use std::convert::TryFrom;
67: use std::convert::TryFrom;
rust-runtime/aws-smithy-http-tower/src/lib.rs
67: use std::convert::{Infallible, TryInto};
rust-runtime/aws-smithy-xml/src/decode.rs
169:impl<'a> TryFrom<&'a [u8]> for Document<'a> {
rust-runtime/aws-smithy-http/src/header.rs
9:use std::convert::TryFrom;
152: HeaderValue: TryFrom<V>,
153: <HeaderValue as TryFrom<V>>::Error: Into<http::Error>,
172: HeaderValue: TryFrom<V>,
173: <HeaderValue as TryFrom<V>>::Error: Into<http::Error>,
rust-runtime/aws-smithy-eventstream/src/str_bytes.rs
9:use std::convert::TryFrom;
30:/// use std::convert::TryInto;
93:impl TryFrom<&'static [u8]> for StrBytes {
104:impl TryFrom<Vec<u8>> for StrBytes {
115:impl TryFrom<Bytes> for StrBytes {
130: use std::convert::TryInto;
rust-runtime/aws-smithy-eventstream/src/frame.rs
13:use std::convert::{TryFrom, TryInto};
67: use std::convert::TryInto;
503:fn checked<T: TryFrom<U>, U>(from: U, err: Error) -> Result<T, Error> {
rust-runtime/inlineable/src/rest_xml_unwrapped_errors.rs
10:use std::convert::TryFrom;
aws/rust-runtime/aws-http/src/user_agent.rs
14:use std::convert::TryFrom;
aws/rust-runtime/aws-config/src/sso.rs
27:use std::convert::TryInto;
aws/rust-runtime/aws-config/src/json_credentials.rs
11:use std::convert::TryFrom;
rust-runtime/aws-smithy-types/src/date_time/mod.rs
10:use std::convert::TryFrom;
38:/// use std::convert::TryFrom;
248:impl TryFrom<DateTime> for SystemTime {
330: use std::convert::TryFrom;
aws/rust-runtime/aws-config/src/sts/util.rs
10:use std::convert::TryFrom;
aws/rust-runtime/aws-sigv4/src/http_request/sign.rs
17:use std::convert::TryFrom;
aws/rust-runtime/aws-sigv4/src/http_request/canonical_request.rs
17:use std::convert::TryFrom;
rust-runtime/aws-smithy-http-server/examples/pokemon_service/src/lib.rs
12: convert::TryInto,
aws/rust-runtime/aws-config/src/imds/client.rs
11:use std::convert::TryFrom;
codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/protocols/ServerHttpBoundProtocolGenerator.kt
563: let http_status: u16 = TryFrom::<i32>::try_from(status)
...tware/amazon/smithy/rust/codegen/server/smithy/protocols/ServerHttpBoundProtocolGenerator.kt
Outdated
Show resolved
Hide resolved
Generate crates using Rust 2021 instead of Rust 2018 Remove use std::convert::TryFrom which is in the prelude Closes #1332 Signed-off-by: Daniele Ahmed <[email protected]>
A new generated diff is ready to view. A new doc preview is ready to view. Rust Wrk benchmark report:Duration: 90 sec, Connections: 32, Threads: 2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Generate crates using Rust 2021 instead of Rust 2018
Remove use std::convert::TryFrom which is in the prelude
Closes #1332
Signed-off-by: Daniele Ahmed [email protected]
Motivation and Context
Description
Testing
./gradlew :codegen-server-test:test
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.