diff --git a/aws/SDK_CHANGELOG.md b/aws/SDK_CHANGELOG.md index d987142f15fc7f81998d56df1dbd07f625af2795..72ad975c9e9df7ae180379ea893980cf367459b6 100644 --- a/aws/SDK_CHANGELOG.md +++ b/aws/SDK_CHANGELOG.md @@ -362,7 +362,7 @@ This week also sees the addition of a robust async caching credentials provider. To upgrade to the new release, update `tag` to `v0.0.14-alpha`: ``` [dependencies] -# eg. S3: +# e.g. S3: aws-sdk-s3 = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.14-alpha" } ``` @@ -455,7 +455,7 @@ To update to the new release, change your tag to `v0.0.10-alpha`. - :tada: Add support for EKS (smithy-rs#553) - :warning: **Breaking Change:** httpLabel no longer causes fields to be non-optional. You may need to adapt code that uses models. (#537) - :warning: **Breaking Change:** `Exception` is **not** renamed to `Error`. Code may need to be updated to replace `Error` with `Exception` when naming error shapes. -- :warning: **Breaking Change:** Models are now in strict pascal case including acronyms (eg. `dynamodb::model::{SSESpecification => SseSpecification}`) +- :warning: **Breaking Change:** Models are now in strict pascal case including acronyms (e.g. `dynamodb::model::{SSESpecification => SseSpecification}`) - Add more SES examples, and improve examples for Batch. - Improved error handling ergonomics: Errors now provide `is_()` methods to simplify error handling - :bug: Bugfix: Fix bug in `create_multipart_upload`: #127 (smithy-rs#531, @eagletmt) @@ -477,7 +477,7 @@ To upgrade to the new release, update `tag` to `v0.0.9-alpha`: ```toml [dependencies] -# eg. Cloudwatch Logs: +# e.g. Cloudwatch Logs: aws-sdk-cloudwatchlogs = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.9-alpha" } ``` @@ -510,7 +510,7 @@ To upgrade to the new release, update `tag` to `v0.0.8-alpha`: ```toml [dependencies] -# eg. EC2: +# e.g. EC2: aws-sdk-ec2 = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.8-alpha" } ``` @@ -541,7 +541,7 @@ This week we’ve added MediaLive, MediaPackage, SNS, Batch, STS, RDS, RDSData, To upgrade to the new release, update `tag` to `v0.0.7-alpha`: ```toml [dependencies] -# eg. SNS: +# e.g. SNS: aws-sdk-sns = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.7-alpha" } ``` @@ -594,7 +594,7 @@ Thanks! v0.0.5-alpha (May 25th, 2021) ============================= -You can install the new release by updating your dependencies to `tag = "v0.0.5-alpha"`, eg. +You can install the new release by updating your dependencies to `tag = "v0.0.5-alpha"`, e.g. ```toml [dependencies] aws-sdk-s3 = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.5-alpha" } @@ -622,7 +622,7 @@ Thanks! v0.0.4-alpha (May 18th, 2021) ============================= -You can install the new release by updating your dependencies to `tag = "v0.0.4-alpha"`, eg. +You can install the new release by updating your dependencies to `tag = "v0.0.4-alpha"`, e.g. ```toml [dependencies] aws-sdk-lambda = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.4-alpha" } @@ -636,7 +636,7 @@ aws-sdk-lambda = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0. - Types represented by the Smithy `Set` type now generate `Vec` in all cases. This is also technically breaking but not currently exposed. (smithy-rs#270) - Bugfix: The `.message()`field of errors will now look for both `message` and `Message` in the model (smithy-rs#374) - Add support for the `AWS_REGION` environment variable. (smithy-rs#362) -- The request type generated by the fluent builders, eg. `dynamodb.list_tables()` is now `Debug` (smithy-rs#377, @declanvk) +- The request type generated by the fluent builders, e.g. `dynamodb.list_tables()` is now `Debug` (smithy-rs#377, @declanvk) And more: See the corresponding [smithy-rs release](https://github.com/awslabs/smithy-rs/releases/tag/v0.9). diff --git a/aws/rust-runtime/aws-config/integration-tests/eks-credentials/README.md b/aws/rust-runtime/aws-config/integration-tests/eks-credentials/README.md index 209142a11645b25cb0107a38c4a53cef1fb7cfa8..77b5a4e2aa56aa453ba723fb1c072b646205239d 100644 --- a/aws/rust-runtime/aws-config/integration-tests/eks-credentials/README.md +++ b/aws/rust-runtime/aws-config/integration-tests/eks-credentials/README.md @@ -10,5 +10,5 @@ cdk bootstrap aws://accountid/region cdk deploy # make lunch, go for a bike ride, etc. ~1h. kubectl exec rust-sdk-test -it bash -# write some rust code, eg. test.rs, run it. +# write some rust code, e.g. test.rs, run it. ``` diff --git a/aws/rust-runtime/aws-config/src/ecs.rs b/aws/rust-runtime/aws-config/src/ecs.rs index 73ad4468f3d75c1544d453c48813804823274e22..6c2b93ef74068c1f0cabcf1894445276aedb9d68 100644 --- a/aws/rust-runtime/aws-config/src/ecs.rs +++ b/aws/rust-runtime/aws-config/src/ecs.rs @@ -5,7 +5,7 @@ //! Ecs Credentials Provider //! -//! This credential provider is frequently used with an AWS-provided credentials service (eg. +//! This credential provider is frequently used with an AWS-provided credentials service (e.g. //! [IAM Roles for tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html). //! However, it's possible to use environment variables to configure this provider to use your own //! credentials sources. diff --git a/aws/rust-runtime/aws-config/src/environment/credentials.rs b/aws/rust-runtime/aws-config/src/environment/credentials.rs index e514287b836ff2273a18039a7b5b6842e6461c36..53e09fe7f198132943cb1d327468c43aeb099c5c 100644 --- a/aws/rust-runtime/aws-config/src/environment/credentials.rs +++ b/aws/rust-runtime/aws-config/src/environment/credentials.rs @@ -47,7 +47,7 @@ impl EnvironmentVariableCredentialsProvider { } #[doc(hidden)] - /// Create a new `EnvironmentVariableCredentialsProvider` with `Env` overriden + /// Create a new `EnvironmentVariableCredentialsProvider` with `Env` overridden /// /// This function is intended for tests that mock out the process environment. pub fn new_with_env(env: Env) -> Self { diff --git a/aws/rust-runtime/aws-config/src/imds/client.rs b/aws/rust-runtime/aws-config/src/imds/client.rs index f1ed47b3f32e04bde5032e44541a0e833f9ccaa0..2c8005567564810019081bf54ee100a45438ecd9 100644 --- a/aws/rust-runtime/aws-config/src/imds/client.rs +++ b/aws/rust-runtime/aws-config/src/imds/client.rs @@ -246,10 +246,10 @@ pub enum ImdsError { /// IO Error /// - /// An error occurred comunication with IMDS + /// An error occurred communication with IMDS IoError(Box), - /// An unexpected error occured communicating with IMDS + /// An unexpected error occurred communicating with IMDS Unexpected(Box), } @@ -270,11 +270,11 @@ impl Display for ImdsError { response ), ImdsError::IoError(err) => { - write!(f, "An IO error occured communicating with IMDS: {}", err) + write!(f, "An IO error occurred communicating with IMDS: {}", err) } ImdsError::Unexpected(err) => write!( f, - "An unexpected error occured communicating with IMDS: {}", + "An unexpected error occurred communicating with IMDS: {}", err ), } @@ -413,7 +413,7 @@ pub enum BuildError { /// The endpoint mode was invalid InvalidEndpointMode(InvalidEndpointMode), - /// The AWS Profile (eg. `~/.aws/config`) was invalid + /// The AWS Profile (e.g. `~/.aws/config`) was invalid InvalidProfile(ProfileParseError), /// The specified endpoint was not a valid URI diff --git a/aws/rust-runtime/aws-config/src/json_credentials.rs b/aws/rust-runtime/aws-config/src/json_credentials.rs index f0e4e133de2344f59cffb3e9e94dba292a072c5f..7008f1cffe0d280a6e3c23c7eb6e5bde47effa54 100644 --- a/aws/rust-runtime/aws-config/src/json_credentials.rs +++ b/aws/rust-runtime/aws-config/src/json_credentials.rs @@ -14,7 +14,7 @@ pub(crate) enum InvalidJsonCredentials { /// The response was missing a required field MissingField(&'static str), - /// Another unhandled error occured + /// Another unhandled error occurred Other(Cow<'static, str>), } diff --git a/aws/rust-runtime/aws-config/src/profile/credentials/repr.rs b/aws/rust-runtime/aws-config/src/profile/credentials/repr.rs index 4daf59cf64ee36c79bae6f1646204ae293391b26..567ae550c5eba0bcaf7bc287cb79b6473d990476 100644 --- a/aws/rust-runtime/aws-config/src/profile/credentials/repr.rs +++ b/aws/rust-runtime/aws-config/src/profile/credentials/repr.rs @@ -42,7 +42,7 @@ impl<'a> ProfileChain<'a> { /// A base member of the profile chain /// /// Base providers do not require input credentials to provide their own credentials, -/// eg. IMDS, ECS, Environment variables +/// e.g. IMDS, ECS, Environment variables #[derive(Debug, Clone)] #[non_exhaustive] pub enum BaseProvider<'a> { diff --git a/aws/rust-runtime/aws-config/src/provider_config.rs b/aws/rust-runtime/aws-config/src/provider_config.rs index 4628e9aface533800a859b2df3cac5d7bcd61dfe..d4d3b46df9c093f04d42f069f465fc5f3f678cfa 100644 --- a/aws/rust-runtime/aws-config/src/provider_config.rs +++ b/aws/rust-runtime/aws-config/src/provider_config.rs @@ -123,7 +123,7 @@ impl ProviderConfig { /// HttpSettings for HTTP connectors /// -/// # Stabilility +/// # Stability /// As HTTP settings stabilize, they will move to `aws-types::config::Config` so that they /// can be used to configure HTTP connectors for service clients. #[non_exhaustive] diff --git a/aws/rust-runtime/aws-config/src/sts.rs b/aws/rust-runtime/aws-config/src/sts.rs index 7c7b7e0f31e9d5ef5b742748e22044194572726f..1c527c019f4b3fdb3410a9fb408f05c567f5cfa8 100644 --- a/aws/rust-runtime/aws-config/src/sts.rs +++ b/aws/rust-runtime/aws-config/src/sts.rs @@ -47,7 +47,7 @@ pub(crate) mod util { /// /// STS Assume Role providers MUST assign a name to their generated session. When a user does not /// provide a name for the session, the provider will choose a name composed of a base + a timestamp, - /// eg. `profile-file-provider-123456789` + /// e.g. `profile-file-provider-123456789` pub(crate) fn default_session_name(base: &str) -> String { let now = SystemTime::now() .duration_since(UNIX_EPOCH) diff --git a/aws/rust-runtime/aws-sig-auth/src/middleware.rs b/aws/rust-runtime/aws-sig-auth/src/middleware.rs index a7f9851f5574a848d38accf671f650738c8cf9f6..57285396fdaebb59d995d369e53cf41f8807d4d6 100644 --- a/aws/rust-runtime/aws-sig-auth/src/middleware.rs +++ b/aws/rust-runtime/aws-sig-auth/src/middleware.rs @@ -38,10 +38,10 @@ impl AsRef for Signature { /// a signature. /// /// Prior to signing, the following fields MUST be present in the property bag: -/// - [`SigningRegion`](SigningRegion): The region used when signing the request, eg. `us-east-1` -/// - [`SigningService`](SigningService): The name of the service to use when signing the request, eg. `dynamodb` +/// - [`SigningRegion`](SigningRegion): The region used when signing the request, e.g. `us-east-1` +/// - [`SigningService`](SigningService): The name of the service to use when signing the request, e.g. `dynamodb` /// - [`Credentials`](Credentials): Credentials to sign with -/// - [`OperationSigningConfig`](OperationSigningConfig): Operation specific signing configuration, eg. +/// - [`OperationSigningConfig`](OperationSigningConfig): Operation specific signing configuration, e.g. /// changes to URL encoding behavior, or headers that must be omitted. /// If any of these fields are missing, the middleware will return an error. /// diff --git a/aws/rust-runtime/aws-sigv4/src/http_request/settings.rs b/aws/rust-runtime/aws-sigv4/src/http_request/settings.rs index 729e788bb31c64e0ec569a3d1a8e2e2f83a44308..b35332628814587b976c80437f1fe8fb8ca877ff 100644 --- a/aws/rust-runtime/aws-sigv4/src/http_request/settings.rs +++ b/aws/rust-runtime/aws-sigv4/src/http_request/settings.rs @@ -50,7 +50,7 @@ pub enum PayloadChecksumKind { #[non_exhaustive] #[derive(Debug, Eq, PartialEq)] pub enum PercentEncodingMode { - /// Re-encode the resulting URL (eg. %30 becomes `%2530) + /// Re-encode the resulting URL (e.g. %30 becomes `%2530) Double, /// Take the resulting URL as-is diff --git a/aws/rust-runtime/aws-sigv4/src/http_request/test.rs b/aws/rust-runtime/aws-sigv4/src/http_request/test.rs index c793243d43e07263322e0e3cca13a492a80ddd3f..c9d26c21676e192f6d0a06d31b73549a07a7298a 100644 --- a/aws/rust-runtime/aws-sigv4/src/http_request/test.rs +++ b/aws/rust-runtime/aws-sigv4/src/http_request/test.rs @@ -64,7 +64,7 @@ fn parse_request( s: &[u8], ) -> Result, Box> { let mut headers = [httparse::EMPTY_HEADER; 64]; - // httparse 1.5 requres two trailing newlines to head the header section. + // httparse 1.5 requires two trailing newlines to head the header section. let mut with_newline = Vec::from(s); with_newline.push(b'\n'); let mut req = httparse::Request::new(&mut headers); diff --git a/aws/rust-runtime/aws-types/src/credentials/credentials_impl.rs b/aws/rust-runtime/aws-types/src/credentials/credentials_impl.rs index b2db3d43d9f80bad5459e20b5590db33c5c62cb5..c245d2e2db5d728ceaf5ed9ea6c8f9157851be3e 100644 --- a/aws/rust-runtime/aws-types/src/credentials/credentials_impl.rs +++ b/aws/rust-runtime/aws-types/src/credentials/credentials_impl.rs @@ -27,9 +27,9 @@ struct Inner { /// Credential Expiry /// - /// A timepoint at which the credentials should no longer - /// be used because they have expired. The primary purpose of this value is to allow - /// credentials to communicate to the caching provider when they need to be refreshed. + /// A SystemTime at which the credentials should no longer be used because they have expired. + /// The primary purpose of this value is to allow credentials to communicate to the caching + /// provider when they need to be refreshed. /// /// If these credentials never expire, this value will be set to `None` expires_after: Option, diff --git a/aws/rust-runtime/aws-types/src/credentials/provider.rs b/aws/rust-runtime/aws-types/src/credentials/provider.rs index 7da6fbbdf3e8684befbbdbe3591aae339c805b2d..17f74692b0ff2a554e7b7f8282c445de885427f2 100644 --- a/aws/rust-runtime/aws-types/src/credentials/provider.rs +++ b/aws/rust-runtime/aws-types/src/credentials/provider.rs @@ -65,7 +65,7 @@ impl CredentialsError { } } - /// An unexpected error occured loading credentials from this provider + /// An unexpected error occurred loading credentials from this provider /// /// Unhandled errors should not occur during normal operation and should be reserved for exceptional /// cases, such as a JSON API returning an output that was not parseable as JSON. @@ -77,7 +77,7 @@ impl CredentialsError { /// The credentials provider returned an error /// - /// Provider errors may occur during normal use of a credentials provider, eg. a 503 when + /// Provider errors may occur during normal use of a credentials provider, e.g. a 503 when /// retrieving credentials from IMDS. pub fn provider_error(cause: impl Into>) -> Self { Self::ProviderError { @@ -120,7 +120,7 @@ impl Display for CredentialsError { ) } CredentialsError::ProviderError { cause } => { - write!(f, "An error occured while loading credentials: {}", cause) + write!(f, "An error occurred while loading credentials: {}", cause) } } } diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsReadmeDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsReadmeDecorator.kt index 0894198593c4deb4ea5a3a1cfe9c5c9d3c9584a2..697ef68c4747cb733727ba0b456ea61df9eb057a 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsReadmeDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsReadmeDecorator.kt @@ -54,7 +54,7 @@ class AwsReadmeDecorator : RustCodegenDecorator { """ ## Getting Started - > Examples are availble for many services and operations, check out the + > Examples are available for many services and operations, check out the > [examples folder in GitHub](https://github.com/awslabs/aws-sdk-rust/tree/main/sdk/examples). The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio) diff --git a/aws/sdk/examples/config/src/bin/config-helloworld.rs b/aws/sdk/examples/config/src/bin/config-helloworld.rs index 801a24674253cbb2b1f519f12bc4ecf87154d316..7c0e77bcee123e42714b7c95231a94e1571760e5 100644 --- a/aws/sdk/examples/config/src/bin/config-helloworld.rs +++ b/aws/sdk/examples/config/src/bin/config-helloworld.rs @@ -18,7 +18,7 @@ struct Opt { #[structopt(long)] resource_id: String, - /// The resource type, eg. "AWS::EC2::SecurityGroup" + /// The resource type, e.g. "AWS::EC2::SecurityGroup" #[structopt(long)] resource_type: String, diff --git a/aws/sdk/examples/kms/src/bin/decrypt.rs b/aws/sdk/examples/kms/src/bin/decrypt.rs index fa5a8d654ec98768ae419b7a93bd5043c46c7841..8e4c80c0c353c9f319037ebd6484f5abe290de6f 100644 --- a/aws/sdk/examples/kms/src/bin/decrypt.rs +++ b/aws/sdk/examples/kms/src/bin/decrypt.rs @@ -22,7 +22,7 @@ struct Opt { #[structopt(short, long)] input_file: String, - /// Whether to display additonal informmation. + /// Whether to display additional information. #[structopt(short, long)] verbose: bool, } diff --git a/aws/sdk/examples/kms/src/bin/generate-data-key-without-plaintext.rs b/aws/sdk/examples/kms/src/bin/generate-data-key-without-plaintext.rs index c09a3e718e0d790052ac4af76bafe00a1ddc25e3..9f3f5f421367578e2ed9956c4ca083753c2cd05c 100644 --- a/aws/sdk/examples/kms/src/bin/generate-data-key-without-plaintext.rs +++ b/aws/sdk/examples/kms/src/bin/generate-data-key-without-plaintext.rs @@ -17,7 +17,7 @@ struct Opt { #[structopt(short, long)] key: String, - /// Whether to display additonal information. + /// Whether to display additional information. #[structopt(short, long)] verbose: bool, } diff --git a/aws/sdk/examples/kms/src/bin/generate-data-key.rs b/aws/sdk/examples/kms/src/bin/generate-data-key.rs index a19790f26f85831f05724a4c37db9d93a3e41078..4817b40cd45b5b19e3c37b3a64d6f4a18a23f897 100644 --- a/aws/sdk/examples/kms/src/bin/generate-data-key.rs +++ b/aws/sdk/examples/kms/src/bin/generate-data-key.rs @@ -18,7 +18,7 @@ struct Opt { #[structopt(short, long)] key: String, - /// Whether to display additonal informmation. + /// Whether to display additional information. #[structopt(short, long)] verbose: bool, } diff --git a/aws/sdk/examples/kms/src/bin/generate-random.rs b/aws/sdk/examples/kms/src/bin/generate-random.rs index 3cdeeb763f0939943af0cb3fe994b8711acacc2e..77374b1d863cd66b14897289a41222331c6d4f56 100644 --- a/aws/sdk/examples/kms/src/bin/generate-random.rs +++ b/aws/sdk/examples/kms/src/bin/generate-random.rs @@ -18,7 +18,7 @@ struct Opt { #[structopt(short, long)] length: i32, - /// Whether to display additonal informmation. + /// Whether to display additional information. #[structopt(short, long)] verbose: bool, } diff --git a/aws/sdk/examples/kms/src/bin/reencrypt-data.rs b/aws/sdk/examples/kms/src/bin/reencrypt-data.rs index 379e7b3a31e3d3ab04ab81ef6684f27287dfdd7c..2c27ecc503b737dd67712c4d0c8368eda1637895 100644 --- a/aws/sdk/examples/kms/src/bin/reencrypt-data.rs +++ b/aws/sdk/examples/kms/src/bin/reencrypt-data.rs @@ -32,7 +32,7 @@ struct Opt { #[structopt(short, long)] output_file: String, - /// Whether to display additonal runtime information. + /// Whether to display additional runtime information. #[structopt(short, long)] verbose: bool, } diff --git a/aws/sdk/examples/secretsmanager/src/bin/create-secret.rs b/aws/sdk/examples/secretsmanager/src/bin/create-secret.rs index f106707876def6e436b03b617c9c93547b5696e1..117b78c1e2659f73b63ea2a74aefd43c9dd4a710 100644 --- a/aws/sdk/examples/secretsmanager/src/bin/create-secret.rs +++ b/aws/sdk/examples/secretsmanager/src/bin/create-secret.rs @@ -26,7 +26,7 @@ struct Opt { #[structopt(short, long)] secret_value: String, - /// Whether to display additonal runtime information + /// Whether to display additional runtime information #[structopt(short, long)] verbose: bool, } diff --git a/aws/sdk/examples/secretsmanager/src/bin/get-secret-value.rs b/aws/sdk/examples/secretsmanager/src/bin/get-secret-value.rs index ccc4e09568bbfedb46dba0a6260a328860ac2a50..d67664d43f5a07e190cb09a1406ca38cb2a38499 100644 --- a/aws/sdk/examples/secretsmanager/src/bin/get-secret-value.rs +++ b/aws/sdk/examples/secretsmanager/src/bin/get-secret-value.rs @@ -23,7 +23,7 @@ struct Opt { #[structopt(short, long)] name: String, - /// Whether to display additonal runtime information + /// Whether to display additional runtime information #[structopt(short, long)] verbose: bool, } diff --git a/aws/sdk/examples/secretsmanager/src/bin/list-secrets.rs b/aws/sdk/examples/secretsmanager/src/bin/list-secrets.rs index d6d77e830d7f01b34a63a93789ff40d90361f999..d0cd6d20509b1e54eb0d68e7a3e0e5a25c993784 100644 --- a/aws/sdk/examples/secretsmanager/src/bin/list-secrets.rs +++ b/aws/sdk/examples/secretsmanager/src/bin/list-secrets.rs @@ -19,7 +19,7 @@ struct Opt { #[structopt(short, long)] region: Option, - /// Whether to display additonal runtime information + /// Whether to display additional runtime information #[structopt(short, long)] verbose: bool, } diff --git a/aws/sdk/examples/ssm/src/bin/create-parameter.rs b/aws/sdk/examples/ssm/src/bin/create-parameter.rs index ba071bc1328dd5eb16fad36969737031c26f1c80..6992a07c57baccf9ae53ecbfcb06c2f8f799da7a 100644 --- a/aws/sdk/examples/ssm/src/bin/create-parameter.rs +++ b/aws/sdk/examples/ssm/src/bin/create-parameter.rs @@ -67,8 +67,8 @@ async fn main() { shared_config.region().unwrap() ); println!("Parameter name: {}", name); - println!("Paramter value: {}", parameter_value); - println!("Paramter description: {}", description); + println!("Parameter value: {}", parameter_value); + println!("Parameter description: {}", description); tracing_subscriber::fmt::init(); } diff --git a/aws/sdk/integration-tests/README.md b/aws/sdk/integration-tests/README.md index 920ad87552482253e686de03aa83585640c6a33a..354ff321190157acebc07a524d52490c04313244 100644 --- a/aws/sdk/integration-tests/README.md +++ b/aws/sdk/integration-tests/README.md @@ -3,7 +3,7 @@ This folder contains hand-written integration tests that are specific to individual services. In order for your test to be merged into the final artifact: -- The crate name must match the generated crate name, eg. `kms`, `dynamodb` +- The crate name must match the generated crate name, e.g. `kms`, `dynamodb` - Your test must be placed into the `tests` folder. **Everything else in your test crate is ignored.** The contents of the `test` folder will be combined with code-generated integration diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/RustCodegenPlugin.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/RustCodegenPlugin.kt index 9afd2e8b0466a637faae2fdd13c4ee05b626f737..2ce7915ee9566e284e814722222e0337653286d8 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/RustCodegenPlugin.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/RustCodegenPlugin.kt @@ -37,12 +37,12 @@ class RustCodegenPlugin : SmithyBuildPlugin { Logger.getLogger(ReservedWordSymbolProvider::class.java.name).level = Level.OFF // Discover `RustCodegenDecorators` on the classpath. `RustCodegenDectorator` return different types of // customization. A customization is a function of: - // - location (eg. the mutate section of an operation) - // - context (eg. the of the operation) + // - location (e.g. the mutate section of an operation) + // - context (e.g. the of the operation) // - writer: The active RustWriter at the given location val codegenDecorator = CombinedCodegenDecorator.fromClasspath(context) - // CodegenVistor is the main driver of code generation that traverses the model and generates code + // CodegenVisitor is the main driver of code generation that traverses the model and generates code CodegenVisitor(context, codegenDecorator).execute() } @@ -50,7 +50,7 @@ class RustCodegenPlugin : SmithyBuildPlugin { /** SymbolProvider * When generating code, smithy types need to be converted into Rust types—that is the core role of the symbol provider * - * The Symbol provider is composed of a base `SymbolVisitor` which handles the core funcitonality, then is layered + * The Symbol provider is composed of a base `SymbolVisitor` which handles the core functionality, then is layered * with other symbol providers, documented inline, to handle the full scope of Smithy types. */ fun baseSymbolProvider( @@ -59,17 +59,17 @@ class RustCodegenPlugin : SmithyBuildPlugin { symbolVisitorConfig: SymbolVisitorConfig = DefaultConfig ) = SymbolVisitor(model, serviceShape = serviceShape, config = symbolVisitorConfig) - // Generate different types for EventStream shapes (eg. transcribe streaming) + // Generate different types for EventStream shapes (e.g. transcribe streaming) .let { EventStreamSymbolProvider(symbolVisitorConfig.runtimeConfig, it, model) } - // Generate `ByteStream` instead of `Blob` for streaming binary shapes (eg. S3 GetObject) + // Generate `ByteStream` instead of `Blob` for streaming binary shapes (e.g. S3 GetObject) .let { StreamingShapeSymbolProvider(it, model) } // Add Rust attributes (like `#[derive(PartialEq)]`) to generated shapes .let { BaseSymbolMetadataProvider(it) } - // Streaming shapes need different derives (eg. they cannot derive Eq) + // Streaming shapes need different derives (e.g. they cannot derive Eq) .let { StreamingShapeMetadataProvider(it, model) } - // Rename shapes that clash with Rust reserved words & and other SDK specific features eg. `send()` cannot + // Rename shapes that clash with Rust reserved words & and other SDK specific features e.g. `send()` cannot // be the name of an operation input .let { RustReservedWordSymbolProvider(it) } } diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/RustTypes.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/RustTypes.kt index 27f2e73516a442258db0f36e1905e6f23ca1b924..07e6483d3e09bd072b4a709095f6ede7e12fa913 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/RustTypes.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/RustTypes.kt @@ -27,7 +27,7 @@ sealed class RustType { // TODO: when Kotlin supports, sealed interfaces, seal Container /** * A Rust type that contains [member], another RustType. Used to generically operate over - * shapes that contain other shapes, eg. [stripOuter] and [contains]. + * shapes that contain other shapes, e.g. [stripOuter] and [contains]. */ interface Container { val member: RustType @@ -238,7 +238,7 @@ sealed class Attribute { /** * A custom Attribute * - * [annotation] represents the body of the attribute, eg. `cfg(foo)` in `#[cfg(foo)]` + * [annotation] represents the body of the attribute, e.g. `cfg(foo)` in `#[cfg(foo)]` * If [container] is set, this attribute refers to its container rather than its successor. This generates `#![cfg(foo)]` * * Finally, any symbols listed will be imported when this attribute is rendered. This enables using attributes like diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/RustWriter.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/RustWriter.kt index 77177f649a2bf019254870e4982d29cc07117338..a614bc13e0886ad5f5bf5d719362b283d1fe4bf3 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/RustWriter.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/RustWriter.kt @@ -67,7 +67,7 @@ private fun T.withTemplate( * Write a block to the writer. * If [conditional] is true, the [textBeforeNewLine], followed by [block], followed by [textAfterNewLine] * If [conditional] is false, only [block] is written. - * This enables conditionally wrapping a block in a prefix/suffix, eg. + * This enables conditionally wrapping a block in a prefix/suffix, e.g. * * ``` * writer.withBlock("Some(", ")", conditional = symbol.isOptional()) { @@ -392,7 +392,7 @@ class RustWriter private constructor( } /** - * Generate RustDoc links, eg. [`Abc`](crate::module::Abc) + * Generate RustDoc links, e.g. [`Abc`](crate::module::Abc) */ inner class RustDocLinker : BiFunction { override fun apply(t: Any, u: String): String { diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenContext.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenContext.kt index 57d4c24007dfac6dcfddda9952d126f07a748ac4..88036a6b52399b88ad3c3853f619e007c83ac0a8 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenContext.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenContext.kt @@ -32,11 +32,11 @@ data class CodegenContext( */ val serviceShape: ServiceShape, /** - * Smithy Protocol to generate, eg. RestJson1 + * Smithy Protocol to generate, e.g. RestJson1 */ val protocol: ShapeId, /** - * The name of the cargo crate to generate eg. `aws-sdk-s3` + * The name of the cargo crate to generate e.g. `aws-sdk-s3` * This is loaded from the smithy-build.json during codegen. */ val moduleName: String, diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt index 9700e7647e7fc846cdd99a2b0db7237a4805a77c..b1832103ade65d1b0ab58110e2976c0963d0e728 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt @@ -27,6 +27,7 @@ import java.util.Optional * * This can be configured via the `runtimeConfig.version` field in smithy-build.json */ + data class RuntimeCrateLocation(val path: String?, val version: String?) { init { check(path != null || version != null) { @@ -114,7 +115,7 @@ data class RuntimeType(val name: String?, val dependency: RustDependency?, val n * Convert this [RuntimeType] into a [Symbol]. * * This is not commonly required, but is occasionally useful when you want to force an import without referencing a type - * (eg. when bringing a trait into scope). See [CodegenWriter.addUseImports]. + * (e.g. when bringing a trait into scope). See [CodegenWriter.addUseImports]. */ fun toSymbol(): Symbol { val builder = Symbol.builder().name(name).namespace(namespace, "::") diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RustCodegenPlugin.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RustCodegenPlugin.kt index d83d06e2429716775c7ffb5bb93f5c5aba58d0de..b058ce673eccc37585ba500ec3fca652111878a1 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RustCodegenPlugin.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RustCodegenPlugin.kt @@ -26,14 +26,14 @@ class RustCodegenPlugin : SmithyBuildPlugin { override fun execute(context: PluginContext) { // Suppress extremely noisy logs about reserved words Logger.getLogger(ReservedWordSymbolProvider::class.java.name).level = Level.OFF - // Discover `RustCodegenDecorators` on the classpath. `RustCodegenDectorator` return different types of + // Discover `RustCodegenDecorators` on the classpath. `RustCodegenDecorator` return different types of // customization. A customization is a function of: - // - location (eg. the mutate section of an operation) - // - context (eg. the of the operation) + // - location (e.g. the mutate section of an operation) + // - context (e.g. the of the operation) // - writer: The active RustWriter at the given location val codegenDecorator = CombinedCodegenDecorator.fromClasspath(context) - // CodegenVistor is the main driver of code generation that traverses the model and generates code + // CodegenVisitor is the main driver of code generation that traverses the model and generates code CodegenVisitor(context, codegenDecorator).execute() } @@ -46,15 +46,15 @@ class RustCodegenPlugin : SmithyBuildPlugin { */ fun baseSymbolProvider(model: Model, serviceShape: ServiceShape, symbolVisitorConfig: SymbolVisitorConfig = DefaultConfig) = SymbolVisitor(model, serviceShape = serviceShape, config = symbolVisitorConfig) - // Generate different types for EventStream shapes (eg. transcribe streaming) + // Generate different types for EventStream shapes (e.g. transcribe streaming) .let { EventStreamSymbolProvider(symbolVisitorConfig.runtimeConfig, it, model) } - // Generate `ByteStream` instead of `Blob` for streaming binary shapes (eg. S3 GetObject) + // Generate `ByteStream` instead of `Blob` for streaming binary shapes (e.g. S3 GetObject) .let { StreamingShapeSymbolProvider(it, model) } // Add Rust attributes (like `#[derive(PartialEq)]`) to generated shapes .let { BaseSymbolMetadataProvider(it) } - // Streaming shapes need different derives (eg. they cannot derive Eq) + // Streaming shapes need different derives (e.g. they cannot derive Eq) .let { StreamingShapeMetadataProvider(it, model) } - // Rename shapes that clash with Rust reserved words & and other SDK specific features eg. `send()` cannot + // Rename shapes that clash with Rust reserved words & and other SDK specific features e.g. `send()` cannot // be the name of an operation input .let { RustReservedWordSymbolProvider(it) } } diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolMetadataProvider.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolMetadataProvider.kt index c3a44272dc37d602674c2d70704078fd88538a1a..0d29b634fdda7efcbff5503749b6394ecf5ef68c 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolMetadataProvider.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolMetadataProvider.kt @@ -42,7 +42,7 @@ open class WrappingSymbolProvider(private val base: RustSymbolProvider) : RustSy } /** - * Attach `meta` to symbols. `meta` is used by the generators (eg. StructureGenerator) to configure the generated models. + * Attach `meta` to symbols. `meta` is used by the generators (e.g. StructureGenerator) to configure the generated models. * * Protocols may inherit from this class and override the `xyzMeta` methods to modify structure generation. */ diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customizations/AllowLintsGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customizations/AllowLintsGenerator.kt index 8014f80baea2a47f80ce9f86bdaf2caea0e5746c..06c5afb2fea882594d17d3d485b8976a9a27dfd2 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customizations/AllowLintsGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customizations/AllowLintsGenerator.kt @@ -11,10 +11,10 @@ import software.amazon.smithy.rust.codegen.smithy.generators.LibRsCustomization import software.amazon.smithy.rust.codegen.smithy.generators.LibRsSection val ClippyAllowLints = listOf( - // Sometimes operations are named the same as our module eg. output leading to `output::output` + // Sometimes operations are named the same as our module e.g. output leading to `output::output` "module_inception", - // Currently, we don't recase acronyms in models, eg. SSEVersion + // Currently, we don't recase acronyms in models, e.g. SSEVersion "upper_case_acronyms", // Large errors trigger this warning, we are unlikely to optimize this case currently diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customize/NamedSectionGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customize/NamedSectionGenerator.kt index 7276b666ac36e6fdf2c623e83d64394f009e9f67..0c13ba76509b081901288e62bfbe560ef782e3f3 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customize/NamedSectionGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customize/NamedSectionGenerator.kt @@ -16,7 +16,7 @@ import software.amazon.smithy.rust.codegen.rustlang.writable * // Sections can be state-carrying to allow implementations to make different choices based on * // different operations * data class RequestCreation(protocolConfig: ProtocolConfig, operation: OperationShape) : Section("RequestCreation") - * // Sections can be stateless, eg. this section that could write code into the + * // Sections can be stateless, e.g. this section that could write code into the * // top level operation module * object OperationModule : ServiceConfig("OperationTopLevel") * } diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/BuilderGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/BuilderGenerator.kt index 1e8a846fdb14f1f971d858d39adf389549934554..0ca899a62bdf7aa6c3cf0aa7915cea8b803fe852 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/BuilderGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/BuilderGenerator.kt @@ -180,7 +180,7 @@ class BuilderGenerator( val outerType = memberSymbol.rustType() val coreType = outerType.stripOuter() val memberName = symbolProvider.toMemberName(member) - // Render a context-aware builder method for certain types, eg. a method for vectors that automatically + // Render a context-aware builder method for certain types, e.g. a method for vectors that automatically // appends when (coreType) { is RustType.Vec -> renderVecHelper(member, memberName, coreType) diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EndpointTraitBindingGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EndpointTraitBindingGenerator.kt index 3936589177da967f96a20ad0a83da1346e8ce3e1..204274eea54ebecc7b210f6a74fac4649bfac5d2 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EndpointTraitBindingGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EndpointTraitBindingGenerator.kt @@ -48,7 +48,7 @@ class EndpointTraitBindings( * The returned expression is a `Result` */ fun render(writer: RustWriter, input: String) { - // the Rust format pattern to make the endpoint prefix eg. "{}.foo" + // the Rust format pattern to make the endpoint prefix e.g. "{}.foo" val formatLiteral = endpointTrait.prefixFormatString() if (endpointTrait.hostPrefix.labels.isEmpty()) { // if there are no labels, we don't need string formatting diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/StructureGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/StructureGenerator.kt index db696087573edcef2ac387b4cde8550adea3f792..334940f6cbbb0f270bc3be1207ed656d40576101 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/StructureGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/StructureGenerator.kt @@ -75,7 +75,7 @@ class StructureGenerator( /** * Search for lifetimes used by the members of the struct and generate a declaration. - * eg. `<'a, 'b>` + * e.g. `<'a, 'b>` */ private fun lifetimeDeclaration(): String { val lifetimes = members diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/config/ServiceConfigGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/config/ServiceConfigGenerator.kt index df104047a6d2d7db1405f4480e5a1a68a2fb3aee..8829df735990bb0359d41ae67f460bcf282f7d21 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/config/ServiceConfigGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/config/ServiceConfigGenerator.kt @@ -49,13 +49,13 @@ sealed class ServiceConfig(name: String) : Section(name) { object ConfigStructAdditionalDocs : ServiceConfig("ConfigStructAdditionalDocs") /** - * Struct definition of `Config`. Fields should end with `,` (eg. `foo: Box,`) + * Struct definition of `Config`. Fields should end with `,` (e.g. `foo: Box,`) */ object ConfigStruct : ServiceConfig("ConfigStruct") /** - * impl block of `Config`. (eg. to add functions) - * eg. + * impl block of `Config`. (e.g. to add functions) + * e.g. * ```kotlin * rust("pub fn is_cross_region() -> bool { true }") * ``` @@ -70,7 +70,7 @@ sealed class ServiceConfig(name: String) : Section(name) { /** * Convert from a field in the builder to the final field in config - * eg. + * e.g. * ```kotlin * rust("""my_field: my_field.unwrap_or_else(||"default")""") * ``` diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/error/CombinedErrorGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/error/CombinedErrorGenerator.kt index aba95119a4ffcd5de563caf085be078d3875a502..f47f150159fc45392d3575ee34c1aa53c543bbd4 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/error/CombinedErrorGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/error/CombinedErrorGenerator.kt @@ -88,7 +88,7 @@ class CombinedErrorGenerator( } rust( """ - /// An unexpected error, eg. invalid JSON returned by the service or an unknown error code + /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code Unhandled(Box), """, RuntimeType.StdError diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/protocol/ProtocolGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/protocol/ProtocolGenerator.kt index 1570cdbddfc57575891d89901b1bb37298a880ad..4ce54013a7dddc0a5efd01edefbd06dd4cf099bc 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/protocol/ProtocolGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/protocol/ProtocolGenerator.kt @@ -33,7 +33,7 @@ import software.amazon.smithy.rust.codegen.util.inputShape * **Note:** There is only one real implementation of this interface. The other implementation is test only. * All protocols use the same class. * - * Different protocols (eg. JSON vs. XML) need to use different functionality to generate request bodies. + * Different protocols (e.g. JSON vs. XML) need to use different functionality to generate request bodies. */ interface ProtocolBodyGenerator { data class BodyMetadata(val takesOwnership: Boolean) @@ -75,7 +75,7 @@ interface ProtocolTraitImplGenerator { open class ProtocolGenerator( codegenContext: CodegenContext, /** - * `Protocol` contains all protocol specific information. Each smithy protocol, eg. RestJson, RestXml, etc. will + * `Protocol` contains all protocol specific information. Each smithy protocol, e.g. RestJson, RestXml, etc. will * have their own implementation of the protocol interface which defines how an input shape becomes and http::Request * and an output shape is build from an http::Response. */ diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/Protocol.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/Protocol.kt index dbd79f9b2266746207f07a46f91357e05dc19307..ef51ca66b0a95fce669972587a58d887bc2334d0 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/Protocol.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/Protocol.kt @@ -30,7 +30,7 @@ import software.amazon.smithy.rust.codegen.smithy.protocols.serialize.Structured /** * Describes a protocol to the [HttpBoundProtocolGenerator]. * - * Each protocol (eg. RestXml, RestJson, etc.) will provide its own implementation of the [Protocol] interface. + * Each protocol (e.g. RestXml, RestJson, etc.) will provide its own implementation of the [Protocol] interface. */ interface Protocol { /** Resolves HTTP bindings (which part of a request fields are mapped to) */ diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/parse/StructuredDataParserGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/parse/StructuredDataParserGenerator.kt index fbd36f7a8d87289b5083f4e9257bb3536913d29d..5f2a2ccd7e83fbb3f24aaf053f226cf8a8aa5d32 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/parse/StructuredDataParserGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/parse/StructuredDataParserGenerator.kt @@ -57,7 +57,7 @@ interface StructuredDataParserGenerator { fun documentParser(operationShape: OperationShape): RuntimeType /** - * Generate a parser for a server operation input structuree + * Generate a parser for a server operation input structure * ```rust * fn deser_operation_crate_operation_my_operation_input( * value: &[u8], builder: my_operation_input::Builder diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizer.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizer.kt index 617cd1e68b24121c87766c083094cae64922c453..d23351896a5ebe77a65224812713b21bccc7e74a 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizer.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizer.kt @@ -26,7 +26,7 @@ import kotlin.streams.toList * * This works by **adding** new shapes to the model for operation inputs & outputs. These new shapes have `SyntheticInputTrait` * and `SyntheticOutputTrait` attached to them as needed. This enables downstream code generators to determine if a shape is - * "real" vs. a shape created as a synethic input/output. + * "real" vs. a shape created as a synthetic input/output. * * The trait also tracks the original shape id for certain serialization tasks that require it to exist. */ @@ -34,7 +34,7 @@ object OperationNormalizer { // Functions to construct synthetic shape IDs—Don't rely on these in external code. // Rename safety: Operations cannot be renamed // In order to ensure that the fully qualified smithy id of a synthetic shape can never conflict with an existing shape, - // the `synthetic` namespace is appened. + // the `synthetic` namespace is appended. private fun OperationShape.syntheticInputId() = ShapeId.fromParts(this.id.namespace + ".synthetic", "${this.id.name}Input") @@ -76,7 +76,7 @@ object OperationNormalizer { /** * Synthetic output shape for `operation` - * eg. `Output` + * e.g. `Output` * * If the operation does not have an output, an empty shape is generated */ @@ -95,7 +95,7 @@ object OperationNormalizer { /** * Synthetic input shape for `operation` - * eg. `Input` + * e.g. `Input` * * If the input operation does not have an input, an empty shape is generated */ diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Strings.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Strings.kt index 8203b0dae945ad526ba1df19853ed102c7091957..30b0f07c999adfe05052f2978d4d1305fd220e52 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Strings.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Strings.kt @@ -11,7 +11,7 @@ import software.amazon.smithy.utils.StringUtils fun String.doubleQuote(): String = StringUtils.escapeJavaString(this, "") /** - * Double quote a string, eg. "abc" -> "\"abc\"" + * Double quote a string, e.g. "abc" -> "\"abc\"" */ fun String.dq(): String = this.doubleQuote() diff --git a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/StructureGeneratorTest.kt b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/StructureGeneratorTest.kt index 868bccd2255c05e163275ff338af4a6478c75b32..8fbd1de53932b791fbd891fa9e10446f9f327d0b 100644 --- a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/StructureGeneratorTest.kt +++ b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/StructureGeneratorTest.kt @@ -174,7 +174,7 @@ class StructureGeneratorTest { writer .withModule( "model", - // By attaching this lint, any missing documentation becomes a compiler erorr + // By attaching this lint, any missing documentation becomes a compiler error RustMetadata(additionalAttributes = listOf(Attribute.Custom("deny(missing_docs)")), public = true) ) { StructureGenerator(model, provider, this, model.lookup("com.test#Inner")).render() diff --git a/codegen/src/test/kotlin/software/amazon/smithy/rust/lang/RustWriterTest.kt b/codegen/src/test/kotlin/software/amazon/smithy/rust/lang/RustWriterTest.kt index bddc2b239d6b5290048298163bea7f5ab0d6e38b..126df2d7194dd9bf47e3b8f113be35e994638ffd 100644 --- a/codegen/src/test/kotlin/software/amazon/smithy/rust/lang/RustWriterTest.kt +++ b/codegen/src/test/kotlin/software/amazon/smithy/rust/lang/RustWriterTest.kt @@ -43,7 +43,7 @@ class RustWriterTest { val sut = RustWriter.forModule("parent") val requestBuilder = RuntimeType.HttpRequestBuilder sut.withModule("inner") { - rustBlock("fn build(builer: #T)", requestBuilder) { + rustBlock("fn build(builder: #T)", requestBuilder) { } } val httpDep = CargoDependency.Http.dependencies[0] diff --git a/design/src/rfcs/rfc0001_shared_config.md b/design/src/rfcs/rfc0001_shared_config.md index 9d32a5ca6320fe9c00b5a82db563db8b256124a5..bd2a04ebbe1558a5f65a8334b907d6bd58e5853b 100644 --- a/design/src/rfcs/rfc0001_shared_config.md +++ b/design/src/rfcs/rfc0001_shared_config.md @@ -21,7 +21,7 @@ This document proposes an overhaul to the configuration design to facilitate thr Using the SDK requires two crates: -1. `aws-sdk-`: The service you want to use (eg. `dynamodb`, `s3`, `sesv2`) +1. `aws-sdk-`: The service you want to use (e.g. `dynamodb`, `s3`, `sesv2`) 2. `aws-config`: AWS metaconfiguration. This crate contains all the of logic to load configuration for the SDK (regions, credentials, retry configuration, etc.) @@ -50,7 +50,7 @@ async fn main() -> Result<(), dynamodb::Error> { } ``` -> Tip: Every AWS service exports a top level `Error` type (eg. [aws_sdk_dynamodb::Error](https://awslabs.github.io/aws-sdk-rust/aws_sdk_dynamodb/enum.Error.html)). +> Tip: Every AWS service exports a top level `Error` type (e.g. [aws_sdk_dynamodb::Error](https://awslabs.github.io/aws-sdk-rust/aws_sdk_dynamodb/enum.Error.html)). > Individual operations return specific error types that contain only the [error variants returned by the operation](https://awslabs.github.io/aws-sdk-rust/aws_sdk_dynamodb/error/struct.ListTablesError.html). > Because all the individual errors implement `Into`, you can use `dynamodb::Error` as the return type along with `?`. diff --git a/design/src/smithy/aggregate_shapes.md b/design/src/smithy/aggregate_shapes.md index 586566a40d0fd6659080bad261f7433bb66e81ec..e411277bf5027c575dca225e4bb0bd0019bee560 100644 --- a/design/src/smithy/aggregate_shapes.md +++ b/design/src/smithy/aggregate_shapes.md @@ -17,7 +17,7 @@ List objects in Smithy are transformed into vectors in Rust. Based on the output Because floats are not Hashable in Rust, for simplicity smithy-rs translates all sets to into `Vec` instead of `HashSet`. In the future, a breaking change may be made to introduce a library-provided wrapper type for Sets. ## Map -Because `key` MUST be a string in Smithy maps, we avoid the hashibility issue encountered with `Set`. There are optimizations that could be considered (eg. since these maps will probably never be modified), however, pending customer feedback, Smithy Maps become `HashMap` in Rust. +Because `key` MUST be a string in Smithy maps, we avoid the hashibility issue encountered with `Set`. There are optimizations that could be considered (e.g. since these maps will probably never be modified), however, pending customer feedback, Smithy Maps become `HashMap` in Rust. ## Structure > See `StructureGenerator.kt` for more details diff --git a/design/src/smithy/overview.md b/design/src/smithy/overview.md index bf90fa92b5ccd113b0b2dc98f24e6fafb0dca57d..e41d96a70c0ce1326d65707044ef2aa59db06eea 100644 --- a/design/src/smithy/overview.md +++ b/design/src/smithy/overview.md @@ -1,13 +1,13 @@ # Smithy The Rust SDK uses Smithy models and code generation tooling to generate an SDK. Smithy is an open source IDL (interface design language) developed by Amazon. Although the Rust SDK uses Smithy models for AWS services, smithy-rs and Smithy models in general are not AWS specific. -Design documentation here covers both our implementation of Smithy Primitives (eg. simple shape) as well as more complex Smithy traits like [Endpoint](./endpoint.md). +Design documentation here covers both our implementation of Smithy Primitives (e.g. simple shape) as well as more complex Smithy traits like [Endpoint](./endpoint.md). ## Internals Smithy introduces a few concepts that are defined here: 1. Shape: The core Smithy primitive. A smithy model is composed of nested shapes defining an API. -1. `Symbol`: A Representation of a type including namespaces & and any dependencies required to use a type. A shape can be converted into a symbol by a `SymbolVisitor`. A `SymbolVisitor` maps shapes to types in your programming language (eg. Rust). In the Rust SDK, see [SymbolVisitor.kt](https://github.com/awslabs/smithy-rs/blob/c049a37f8cba5f9bec2e96c28db83e7efb2edc53/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt). Symbol visitors are composable—many specific behaviors are mixed in via small & focused symbol providers, eg. support for the streaming trait is mixed in separately. +1. `Symbol`: A Representation of a type including namespaces & and any dependencies required to use a type. A shape can be converted into a symbol by a `SymbolVisitor`. A `SymbolVisitor` maps shapes to types in your programming language (e.g. Rust). In the Rust SDK, see [SymbolVisitor.kt](https://github.com/awslabs/smithy-rs/blob/c049a37f8cba5f9bec2e96c28db83e7efb2edc53/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt). Symbol visitors are composable—many specific behaviors are mixed in via small & focused symbol providers, e.g. support for the streaming trait is mixed in separately. 2. `Writer`: Writers are code generation primitives that collect code prior to being written to a file. Writers enable language specific helpers to be added to simplify codegen for a given language. For example, `smithy-rs` adds `rustBlock` to [`RustWriter`](https://github.com/awslabs/smithy-rs/blob/908dec558e26bbae6fe4b7d9d1c221dd81699b59/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/RustWriter.kt) to create a "Rust block" of code. ```kotlin writer.rustBlock("struct Model") { @@ -24,4 +24,4 @@ Smithy introduces a few concepts that are defined here: } ``` -3. Generators: A Generator, eg. `StructureGenerator`, `UnionGenerator` generates more complex Rust code from a Smithy model. Protocol generators pull these individual tools together to generate code for an entire service / protocol. +3. Generators: A Generator, e.g. `StructureGenerator`, `UnionGenerator` generates more complex Rust code from a Smithy model. Protocol generators pull these individual tools together to generate code for an entire service / protocol. diff --git a/design/src/transport/middleware.md b/design/src/transport/middleware.md index 07a1e473887f66587480ce0df20b070a45e45eb5..bf7a1bc7e961f603bcabb31f05a858ff528efafd 100644 --- a/design/src/transport/middleware.md +++ b/design/src/transport/middleware.md @@ -4,4 +4,4 @@ Signing, endpoint specification, and logging are all handled as middleware. The Middleware is defined as minimally as possible, then adapted into the middleware system used by the IO layer. Tower is the de facto standard for HTTP middleware in Rust—we will probably use it. But we also want to make our middleware usable for users who aren't using Tower (or if we decide to not use Tower in the long run). -Because of this, rather than implementing all our middleware as "Tower Middleware", we implement it narrowly (eg. as a function that operates on `operation::Request`), then define optional adapters to make our middleware tower compatible. +Because of this, rather than implementing all our middleware as "Tower Middleware", we implement it narrowly (e.g. as a function that operates on `operation::Request`), then define optional adapters to make our middleware tower compatible. diff --git a/rust-runtime/aws-smithy-http-tower/src/lib.rs b/rust-runtime/aws-smithy-http-tower/src/lib.rs index 40922365606634e8750a6eed8d38ee693d06939f..b1d75fa18200ca10a86d9acee48befac408741cf 100644 --- a/rust-runtime/aws-smithy-http-tower/src/lib.rs +++ b/rust-runtime/aws-smithy-http-tower/src/lib.rs @@ -18,7 +18,7 @@ use tower::BoxError; /// SDK never attempted to dispatch the underlying `http::Request`. These represent errors that /// occurred during the request construction pipeline. These generally stem from configuration issues. /// 2. [`RequestDispatchError`](SendOperationError::RequestDispatchError): Errors where the inner -/// tower service failed (eg. because the hostname couldn't be resolved, connection errors, +/// tower service failed (e.g. because the hostname couldn't be resolved, connection errors, /// socket hangup etc.). In this case, we don't know how much of the request was _actually_ sent /// to the client. We only know that we never got back an `http::Response` (and instead got an error). /// @@ -30,7 +30,7 @@ use tower::BoxError; pub enum SendOperationError { /// The request could not be constructed /// - /// These errors usually stem from configuration issues (eg. no region, bad credential provider, etc.) + /// These errors usually stem from configuration issues (e.g. no region, bad credential provider, etc.) RequestConstructionError(BoxError), /// The request could not be dispatched diff --git a/rust-runtime/aws-smithy-http/src/operation.rs b/rust-runtime/aws-smithy-http/src/operation.rs index 0f3bec7f5cf0bd329855e549bf4289d46f3657b0..272153b2c877ef60dbee9b41a2e512c12b2525fd 100644 --- a/rust-runtime/aws-smithy-http/src/operation.rs +++ b/rust-runtime/aws-smithy-http/src/operation.rs @@ -44,10 +44,10 @@ pub struct Parts { pub metadata: Option, } -/// An error occured attempting to build an `Operation` from an input +/// An error occurred attempting to build an `Operation` from an input /// /// These are almost always due to user error caused by limitations of specific fields due to -/// protocol serialization (eg. fields that can only be a subset ASCII because they are serialized +/// protocol serialization (e.g. fields that can only be a subset ASCII because they are serialized /// as the name of an HTTP header) #[non_exhaustive] #[derive(Debug, Error)] diff --git a/rust-runtime/aws-smithy-http/src/response.rs b/rust-runtime/aws-smithy-http/src/response.rs index d7902e7a5322a56ea4210eb4f976204051087296..780aff6951618571aaab558fbb6d8e901babde6a 100644 --- a/rust-runtime/aws-smithy-http/src/response.rs +++ b/rust-runtime/aws-smithy-http/src/response.rs @@ -50,7 +50,7 @@ pub trait ParseHttpResponse { /// APIs like AwsJson 1.0/1.1 and the error path of most streaming APIs /// /// Using an explicit body type of Bytes here is a conscious decision—If you _really_ need - /// to precisely control how the data is loaded into memory (eg. by using `bytes::Buf`), implement + /// to precisely control how the data is loaded into memory (e.g. by using `bytes::Buf`), implement /// your handler in `parse_unloaded`. /// /// Production code will never call `parse_loaded` without first calling `parse_unloaded`. However, diff --git a/rust-runtime/aws-smithy-http/src/result.rs b/rust-runtime/aws-smithy-http/src/result.rs index 99bf6eb096bc4d875bde83f78ac5e07b5d46df48..e55e734384c3eade4713c3256b9ac72d30a86425 100644 --- a/rust-runtime/aws-smithy-http/src/result.rs +++ b/rust-runtime/aws-smithy-http/src/result.rs @@ -23,7 +23,7 @@ type BoxError = Box; /// Successful SDK Result #[derive(Debug)] pub struct SdkSuccess { - /// Raw Response from the service. (eg. Http Response) + /// Raw Response from the service. (e.g. Http Response) pub raw: operation::Response, /// Parsed response from the service @@ -93,7 +93,7 @@ impl ConnectorError { } } - /// Construct a [`ConnectorError`] from an error caused by the user (eg. invalid HTTP request) + /// Construct a [`ConnectorError`] from an error caused by the user (e.g. invalid HTTP request) pub fn user(err: BoxError) -> Self { Self { err, @@ -101,7 +101,7 @@ impl ConnectorError { } } - /// Construct a [`ConnectorError`] from an IO related error (eg. socket hangup) + /// Construct a [`ConnectorError`] from an IO related error (e.g. socket hangup) pub fn io(err: BoxError) -> Self { Self { err, @@ -148,7 +148,7 @@ enum ConnectorErrorKind { /// A timeout occurred while processing the request Timeout, - /// A user-caused error (eg. invalid HTTP request) + /// A user-caused error (e.g. invalid HTTP request) User, /// Socket/IO error diff --git a/rust-runtime/aws-smithy-json/fuzz/fuzz_targets/common.rs b/rust-runtime/aws-smithy-json/fuzz/fuzz_targets/common.rs index 6700bf8fd7f731b4c8ebe04a78e90d89cfa7305e..768dd7bd27cb502db28427f1cfc5af6e48c962f1 100644 --- a/rust-runtime/aws-smithy-json/fuzz/fuzz_targets/common.rs +++ b/rust-runtime/aws-smithy-json/fuzz/fuzz_targets/common.rs @@ -14,7 +14,7 @@ pub fn run_data(data: &[u8]) { aws_smithy_json::deserialize::json_token_iter(data).collect::, Error>>() { // Exercise string unescaping since the later comparison against Serde - // reserializes, and thus, loses UTF-16 surrogate pairs. + // re-serializes, and thus, loses UTF-16 surrogate pairs. for token in tokens { if let Token::ValueString { value, .. } = token { if let Ok(unescaped) = value.to_unescaped() { diff --git a/rust-runtime/aws-smithy-types/src/instant/format.rs b/rust-runtime/aws-smithy-types/src/instant/format.rs index 079adb2fb654ca57ea3f1b6b1df4e48744a75dd7..3af7b04ed7a7267b360e586a545ba0bc03d91d8d 100644 --- a/rust-runtime/aws-smithy-types/src/instant/format.rs +++ b/rust-runtime/aws-smithy-types/src/instant/format.rs @@ -45,7 +45,7 @@ pub(crate) mod http_date { /// /// Some notes: /// - HTTP date does not support years before `0000`—this will cause a panic. - /// - If you _don't_ want subsecond precision (eg. if you want strict adherence to the spec), + /// - If you _don't_ want subsecond precision (e.g. if you want strict adherence to the spec), /// you need to zero-out the instant before formatting /// - If subsecond nanos are 0, no fractional seconds are added /// - If subsecond nanos are nonzero, 3 digits of fractional seconds are added diff --git a/rust-runtime/aws-smithy-types/src/retry.rs b/rust-runtime/aws-smithy-types/src/retry.rs index 3f9fe3ab1264d79719dc12e1e68de4fd8f723e98..c6fb1ebb184b058afce2054e8b20b836ab18afc5 100644 --- a/rust-runtime/aws-smithy-types/src/retry.rs +++ b/rust-runtime/aws-smithy-types/src/retry.rs @@ -44,7 +44,7 @@ pub enum ErrorKind { pub trait ProvideErrorKind { /// Returns the `ErrorKind` when the error is modeled as retryable /// - /// If the error kind cannot be determined (eg. the error is unmodeled at the error kind depends + /// If the error kind cannot be determined (e.g. the error is unmodeled at the error kind depends /// on an HTTP status code, return `None`. fn retryable_error_kind(&self) -> Option; @@ -66,7 +66,7 @@ pub enum RetryKind { /// Retry the associated request due to a known `ErrorKind`. Error(ErrorKind), - /// An Explicit retry (eg. from `x-amz-retry-after`). + /// An Explicit retry (e.g. from `x-amz-retry-after`). /// /// Note: The specified `Duration` is considered a suggestion and may be replaced or ignored. Explicit(Duration), diff --git a/rust-runtime/aws-smithy-xml/src/decode.rs b/rust-runtime/aws-smithy-xml/src/decode.rs index b179c93de98682717e44afc0c922bb310e592049..fa5fcfcaadb9eea6d7b45369ba57bf8b6ee4c475 100644 --- a/rust-runtime/aws-smithy-xml/src/decode.rs +++ b/rust-runtime/aws-smithy-xml/src/decode.rs @@ -58,7 +58,7 @@ impl Name<'_> { #[derive(Debug, PartialEq)] pub struct Attr<'a> { name: Name<'a>, - // attribute values can be escaped (eg. with double quotes, so we need a Cow) + // attribute values can be escaped (e.g. with double quotes, so we need a Cow) value: Cow<'a, str>, } diff --git a/rust-runtime/aws-smithy-xml/src/encode.rs b/rust-runtime/aws-smithy-xml/src/encode.rs index 4e99eb446e412a43b06255c322f02711b520d671..93de32738bc6fa99b04c2508f34dd0092ee9b9ec 100644 --- a/rust-runtime/aws-smithy-xml/src/encode.rs +++ b/rust-runtime/aws-smithy-xml/src/encode.rs @@ -23,7 +23,7 @@ impl Display for Error { /// /// XmlWriter (and friends) make generating an invalid XML document a type error. Nested branches /// of the Xml document mutable borrow from the root. You cannot continue writing to the root -/// until the nested branch is dropped and dropping the nested branch writes the terminator (eg. +/// until the nested branch is dropped and dropping the nested branch writes the terminator (e.g. /// closing element). /// /// The one exception to this rule is names—it is possible to construct an invalid Xml Name. However, diff --git a/rust-runtime/aws-smithy-xml/src/unescape.rs b/rust-runtime/aws-smithy-xml/src/unescape.rs index 25e1a7f0ee03f15f2d3bb4fc991109654f1fdcba..2c10ad18b66be9a42b24eecbd33aa24a39958628 100644 --- a/rust-runtime/aws-smithy-xml/src/unescape.rs +++ b/rust-runtime/aws-smithy-xml/src/unescape.rs @@ -29,7 +29,7 @@ pub fn unescape(s: &str) -> Result, XmlError> { res.push_str(prefix); } for section in sections { - // entites look like &; + // entities look like &; match section.find(';') { Some(idx) => { let entity = §ion[..idx]; @@ -40,11 +40,11 @@ pub fn unescape(s: &str) -> Result, XmlError> { "quot" => res.push('"'), "apos" => res.push('\''), entity => { - // eg. + // e.g. let (entity, radix) = if let Some(entity) = entity.strip_prefix("#x") { (entity, 16) } else if let Some(entity) = entity.strip_prefix("#") { - // eg. { + // e.g. { (entity, 10) } else { return Err(XmlError::InvalidEscape {