From 934b1aac067dba596feb617817409345f9835db5 Mon Sep 17 00:00:00 2001 From: Nick Price Date: Mon, 15 Jan 2024 12:48:11 -0800 Subject: [PATCH] Grammar: Fix "it's" vs "its" in several places (#2518) --- axum-core/src/response/into_response.rs | 2 +- axum-core/src/response/into_response_parts.rs | 2 +- axum-extra/src/json_lines.rs | 2 +- axum-extra/src/routing/typed.rs | 2 +- axum-macros/src/from_request.rs | 4 ++-- axum/benches/benches.rs | 2 +- axum/src/docs/middleware.md | 8 ++++---- axum/src/routing/tests/mod.rs | 2 +- examples/README.md | 2 +- examples/low-level-openssl/src/main.rs | 2 +- examples/low-level-rustls/src/main.rs | 2 +- examples/serve-with-hyper/src/main.rs | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/axum-core/src/response/into_response.rs b/axum-core/src/response/into_response.rs index 15608b14..679b0cbb 100644 --- a/axum-core/src/response/into_response.rs +++ b/axum-core/src/response/into_response.rs @@ -47,7 +47,7 @@ use std::{ /// MyError::SomethingElseWentWrong => "something else went wrong", /// }; /// -/// // its often easiest to implement `IntoResponse` by calling other implementations +/// // it's often easiest to implement `IntoResponse` by calling other implementations /// (StatusCode::INTERNAL_SERVER_ERROR, body).into_response() /// } /// } diff --git a/axum-core/src/response/into_response_parts.rs b/axum-core/src/response/into_response_parts.rs index 4be4fc55..72b61bc7 100644 --- a/axum-core/src/response/into_response_parts.rs +++ b/axum-core/src/response/into_response_parts.rs @@ -44,7 +44,7 @@ use std::{convert::Infallible, fmt}; /// } /// } /// -/// // Its also recommended to implement `IntoResponse` so `SetHeader` can be used on its own as +/// // It's also recommended to implement `IntoResponse` so `SetHeader` can be used on its own as /// // the response /// impl<'a> IntoResponse for SetHeader<'a> { /// fn into_response(self) -> Response { diff --git a/axum-extra/src/json_lines.rs b/axum-extra/src/json_lines.rs index 9bd1ba62..fba283b4 100644 --- a/axum-extra/src/json_lines.rs +++ b/axum-extra/src/json_lines.rs @@ -55,7 +55,7 @@ pin_project! { /// JsonLines::new(stream_of_values()).into_response() /// } /// ``` - // we use `AsExtractor` as the default because you're more likely to name this type if its used + // we use `AsExtractor` as the default because you're more likely to name this type if it's used // as an extractor #[must_use] pub struct JsonLines { diff --git a/axum-extra/src/routing/typed.rs b/axum-extra/src/routing/typed.rs index 1f495175..f7542823 100644 --- a/axum-extra/src/routing/typed.rs +++ b/axum-extra/src/routing/typed.rs @@ -321,7 +321,7 @@ where /// Utility trait used with [`RouterExt`] to ensure the second element of a tuple type is a /// given type. /// -/// If you see it in type errors its most likely because the second argument to your handler doesn't +/// If you see it in type errors it's most likely because the second argument to your handler doesn't /// implement [`TypedPath`]. /// /// You normally shouldn't have to use this trait directly. diff --git a/axum-macros/src/from_request.rs b/axum-macros/src/from_request.rs index 474dd0cd..191f1445 100644 --- a/axum-macros/src/from_request.rs +++ b/axum-macros/src/from_request.rs @@ -1003,7 +1003,7 @@ fn infer_state_type_from_field_attributes(fields: &Fields) -> impl Iterator { Box::new(fields_named.named.iter().filter_map(|field| { - // TODO(david): its a little wasteful to parse the attributes again here + // TODO(david): it's a little wasteful to parse the attributes again here // ideally we should parse things once and pass the data down let FromRequestFieldAttrs { via } = parse_attrs("from_request", &field.attrs).ok()?; @@ -1013,7 +1013,7 @@ fn infer_state_type_from_field_attributes(fields: &Fields) -> impl Iterator { Box::new(fields_unnamed.unnamed.iter().filter_map(|field| { - // TODO(david): its a little wasteful to parse the attributes again here + // TODO(david): it's a little wasteful to parse the attributes again here // ideally we should parse things once and pass the data down let FromRequestFieldAttrs { via } = parse_attrs("from_request", &field.attrs).ok()?; diff --git a/axum/benches/benches.rs b/axum/benches/benches.rs index 5bcdc906..bb1c303d 100644 --- a/axum/benches/benches.rs +++ b/axum/benches/benches.rs @@ -198,7 +198,7 @@ impl BenchmarkBuilder { eprintln!("Running {:?} benchmark", self.name); - // indent output from `rewrk` so its easier to read when running multiple benchmarks + // indent output from `rewrk` so it's easier to read when running multiple benchmarks let mut child = cmd.spawn().unwrap(); let stdout = child.stdout.take().unwrap(); let stdout = std::io::BufReader::new(stdout); diff --git a/axum/src/docs/middleware.md b/axum/src/docs/middleware.md index 4ba977b4..1529ef03 100644 --- a/axum/src/docs/middleware.md +++ b/axum/src/docs/middleware.md @@ -16,7 +16,7 @@ axum is unique in that it doesn't have its own bespoke middleware system and instead integrates with [`tower`]. This means the ecosystem of [`tower`] and [`tower-http`] middleware all work with axum. -While its not necessary to fully understand tower to write or use middleware +While it's not necessary to fully understand tower to write or use middleware with axum, having at least a basic understanding of tower's concepts is recommended. See [tower's guides][tower-guides] for a general introduction. Reading the documentation for [`tower::ServiceBuilder`] is also recommended. @@ -31,7 +31,7 @@ axum allows you to add middleware just about anywhere ## Applying multiple middleware -Its recommended to use [`tower::ServiceBuilder`] to apply multiple middleware at +It's recommended to use [`tower::ServiceBuilder`] to apply multiple middleware at once, instead of calling `layer` (or `route_layer`) repeatedly: ```rust @@ -128,9 +128,9 @@ That is: It's a little more complicated in practice because any middleware is free to return early and not call the next layer, for example if a request cannot be -authorized, but its a useful mental model to have. +authorized, but it's a useful mental model to have. -As previously mentioned its recommended to add multiple middleware using +As previously mentioned it's recommended to add multiple middleware using `tower::ServiceBuilder`, however this impacts ordering: ```rust diff --git a/axum/src/routing/tests/mod.rs b/axum/src/routing/tests/mod.rs index 3e66eb7a..144c870d 100644 --- a/axum/src/routing/tests/mod.rs +++ b/axum/src/routing/tests/mod.rs @@ -499,7 +499,7 @@ async fn route_layer() { // it would be nice if this would return `405 Method Not Allowed` // but that requires knowing more about which method route we're calling, which we - // don't know currently since its just a generic `Service` + // don't know currently since it's just a generic `Service` let res = client.post("/foo").await; assert_eq!(res.status(), StatusCode::UNAUTHORIZED); } diff --git a/examples/README.md b/examples/README.md index 10339295..565c1796 100644 --- a/examples/README.md +++ b/examples/README.md @@ -4,4 +4,4 @@ This folder contains numerous examples showing how to use axum. Each example is setup as its own crate so its dependencies are clear. For a list of what the community built with axum, please see the list -[here](../ECOSYSTEM.md). \ No newline at end of file +[here](../ECOSYSTEM.md). diff --git a/examples/low-level-openssl/src/main.rs b/examples/low-level-openssl/src/main.rs index 1b473756..f2839d61 100644 --- a/examples/low-level-openssl/src/main.rs +++ b/examples/low-level-openssl/src/main.rs @@ -73,7 +73,7 @@ async fn main() { // `TokioIo` converts between them. let stream = TokioIo::new(tls_stream); - // Hyper has also its own `Service` trait and doesn't use tower. We can use + // Hyper also has its own `Service` trait and doesn't use tower. We can use // `hyper::service::service_fn` to create a hyper `Service` that calls our app through // `tower::Service::call`. let hyper_service = hyper::service::service_fn(move |request: Request| { diff --git a/examples/low-level-rustls/src/main.rs b/examples/low-level-rustls/src/main.rs index 0a28e979..660225d7 100644 --- a/examples/low-level-rustls/src/main.rs +++ b/examples/low-level-rustls/src/main.rs @@ -68,7 +68,7 @@ async fn main() { // `TokioIo` converts between them. let stream = TokioIo::new(stream); - // Hyper has also its own `Service` trait and doesn't use tower. We can use + // Hyper also has its own `Service` trait and doesn't use tower. We can use // `hyper::service::service_fn` to create a hyper `Service` that calls our app through // `tower::Service::call`. let hyper_service = hyper::service::service_fn(move |request: Request| { diff --git a/examples/serve-with-hyper/src/main.rs b/examples/serve-with-hyper/src/main.rs index 0b9c93d2..8aaab9b0 100644 --- a/examples/serve-with-hyper/src/main.rs +++ b/examples/serve-with-hyper/src/main.rs @@ -6,7 +6,7 @@ //! //! This example shows how to run axum using hyper's low level API. //! -//! The [hyper-util] crate exists to provide high level utilities but its still in early stages of +//! The [hyper-util] crate exists to provide high level utilities but it's still in early stages of //! development. //! //! [hyper-util]: https://crates.io/crates/hyper-util