From 1586d0b0c4f6c785ab6a02c0db49f58deb053a38 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Wed, 27 Oct 2021 13:21:06 -0500 Subject: [PATCH] fix: various typos (#813) * fix: various typos * undo: model spellchecking * revert: bad change to model docs --- aws/SDK_CHANGELOG.md | 16 ++++++++-------- .../integration-tests/eks-credentials/README.md | 2 +- aws/rust-runtime/aws-config/src/ecs.rs | 2 +- .../aws-config/src/environment/credentials.rs | 2 +- aws/rust-runtime/aws-config/src/imds/client.rs | 10 +++++----- .../aws-config/src/json_credentials.rs | 2 +- .../aws-config/src/profile/credentials/repr.rs | 2 +- .../aws-config/src/provider_config.rs | 2 +- aws/rust-runtime/aws-config/src/sts.rs | 2 +- aws/rust-runtime/aws-sig-auth/src/middleware.rs | 6 +++--- .../aws-sigv4/src/http_request/settings.rs | 2 +- .../aws-sigv4/src/http_request/test.rs | 2 +- .../src/credentials/credentials_impl.rs | 6 +++--- .../aws-types/src/credentials/provider.rs | 6 +++--- .../amazon/smithy/rustsdk/AwsReadmeDecorator.kt | 2 +- .../examples/config/src/bin/config-helloworld.rs | 2 +- aws/sdk/examples/kms/src/bin/decrypt.rs | 2 +- .../bin/generate-data-key-without-plaintext.rs | 2 +- .../examples/kms/src/bin/generate-data-key.rs | 2 +- aws/sdk/examples/kms/src/bin/generate-random.rs | 2 +- aws/sdk/examples/kms/src/bin/reencrypt-data.rs | 2 +- .../secretsmanager/src/bin/create-secret.rs | 2 +- .../secretsmanager/src/bin/get-secret-value.rs | 2 +- .../secretsmanager/src/bin/list-secrets.rs | 2 +- aws/sdk/examples/ssm/src/bin/create-parameter.rs | 4 ++-- aws/sdk/integration-tests/README.md | 2 +- .../codegen/server/smithy/RustCodegenPlugin.kt | 16 ++++++++-------- .../smithy/rust/codegen/rustlang/RustTypes.kt | 4 ++-- .../smithy/rust/codegen/rustlang/RustWriter.kt | 4 ++-- .../smithy/rust/codegen/smithy/CodegenContext.kt | 4 ++-- .../smithy/rust/codegen/smithy/RuntimeTypes.kt | 3 ++- .../rust/codegen/smithy/RustCodegenPlugin.kt | 16 ++++++++-------- .../codegen/smithy/SymbolMetadataProvider.kt | 2 +- .../smithy/customizations/AllowLintsGenerator.kt | 4 ++-- .../smithy/customize/NamedSectionGenerator.kt | 2 +- .../smithy/generators/BuilderGenerator.kt | 2 +- .../generators/EndpointTraitBindingGenerator.kt | 2 +- .../smithy/generators/StructureGenerator.kt | 2 +- .../generators/config/ServiceConfigGenerator.kt | 8 ++++---- .../generators/error/CombinedErrorGenerator.kt | 2 +- .../generators/protocol/ProtocolGenerator.kt | 4 ++-- .../rust/codegen/smithy/protocols/Protocol.kt | 2 +- .../parse/StructuredDataParserGenerator.kt | 2 +- .../smithy/transformers/OperationNormalizer.kt | 8 ++++---- .../amazon/smithy/rust/codegen/util/Strings.kt | 2 +- .../codegen/generators/StructureGeneratorTest.kt | 2 +- .../amazon/smithy/rust/lang/RustWriterTest.kt | 2 +- design/src/rfcs/rfc0001_shared_config.md | 4 ++-- design/src/smithy/aggregate_shapes.md | 2 +- design/src/smithy/overview.md | 6 +++--- design/src/transport/middleware.md | 2 +- rust-runtime/aws-smithy-http-tower/src/lib.rs | 4 ++-- rust-runtime/aws-smithy-http/src/operation.rs | 4 ++-- rust-runtime/aws-smithy-http/src/response.rs | 2 +- rust-runtime/aws-smithy-http/src/result.rs | 8 ++++---- .../aws-smithy-json/fuzz/fuzz_targets/common.rs | 2 +- .../aws-smithy-types/src/instant/format.rs | 2 +- rust-runtime/aws-smithy-types/src/retry.rs | 4 ++-- rust-runtime/aws-smithy-xml/src/decode.rs | 2 +- rust-runtime/aws-smithy-xml/src/encode.rs | 2 +- rust-runtime/aws-smithy-xml/src/unescape.rs | 6 +++--- 61 files changed, 116 insertions(+), 115 deletions(-) diff --git a/aws/SDK_CHANGELOG.md b/aws/SDK_CHANGELOG.md index d987142f1..72ad975c9 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 209142a11..77b5a4e2a 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 73ad4468f..6c2b93ef7 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 e514287b8..53e09fe7f 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 f1ed47b3f..2c8005567 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 f0e4e133d..7008f1cff 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 4daf59cf6..567ae550c 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 4628e9afa..d4d3b46df 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 7c7b7e0f3..1c527c019 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 a7f9851f5..57285396f 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 729e788bb..b35332628 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 c793243d4..c9d26c216 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 b2db3d43d..c245d2e2d 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 7da6fbbdf..17f74692b 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 089419859..697ef68c4 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 801a24674..7c0e77bce 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 fa5a8d654..8e4c80c0c 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 c09a3e718..9f3f5f421 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 a19790f26..4817b40cd 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 3cdeeb763..77374b1d8 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 379e7b3a3..2c27ecc50 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 f10670787..117b78c1e 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 ccc4e0956..d67664d43 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 d6d77e830..d0cd6d205 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 ba071bc13..6992a07c5 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 920ad8755..354ff3211 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 9afd2e8b0..2ce7915ee 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 27f2e7351..07e6483d3 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 77177f649..a614bc13e 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 57d4c2400..88036a6b5 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 9700e7647..b1832103a 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 d83d06e24..b058ce673 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 c3a44272d..0d29b634f 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 8014f80ba..06c5afb2f 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 7276b666a..0c13ba765 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 1e8a846fd..0ca899a62 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 393658917..204274eea 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 db6960875..334940f6c 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 df104047a..8829df735 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 aba95119a..f47f15015 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 1570cdbdd..4ce54013a 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 dbd79f9b2..ef51ca66b 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 fbd36f7a8..5f2a2ccd7 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 617cd1e68..d23351896 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 8203b0dae..30b0f07c9 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 868bccd22..8fbd1de53 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 bddc2b239..126df2d71 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 9d32a5ca6..bd2a04ebb 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 586566a40..e411277bf 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 bf90fa92b..e41d96a70 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 07a1e4738..bf7a1bc7e 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 409223656..b1d75fa18 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 0f3bec7f5..272153b2c 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 d7902e7a5..780aff695 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 99bf6eb09..e55e73438 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 6700bf8fd..768dd7bd2 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 079adb2fb..3af7b04ed 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 3f9fe3ab1..c6fb1ebb1 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 b179c93de..fa5fcfcaa 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 4e99eb446..93de32738 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 25e1a7f0e..2c10ad18b 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 { -- GitLab