From 0aa9a11ca46a5c09ed9e3a2853cba40759dafdfc Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Mon, 7 Jun 2021 15:59:40 -0700 Subject: [PATCH] Fix typos throughout codebase. --- CHANGELOG.md | 10 +++++----- contrib/dyn_templates/src/lib.rs | 2 +- core/codegen/src/lib.rs | 2 +- core/codegen/tests/from_form.rs | 4 ++-- core/lib/src/catcher/handler.rs | 2 +- core/lib/src/error.rs | 2 +- core/lib/src/ext.rs | 2 +- core/lib/src/form/context.rs | 8 ++++---- core/lib/src/form/error.rs | 10 +++++----- core/lib/src/form/form.rs | 2 +- core/lib/src/form/from_form.rs | 2 +- core/lib/src/fs/temp_file.rs | 2 +- core/lib/src/route/route.rs | 2 +- core/lib/src/shield/policy.rs | 2 +- site/guide/4-requests.md | 2 +- 15 files changed, 27 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f648c645..f63f54cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -150,7 +150,7 @@ ## Core * Replaced use of `FnBox` with `Box`. - * Removed the stablized feature gates `try_from` and `transpose_result`. + * Removed the stable feature gates `try_from` and `transpose_result`. * Derive macros are reexported alongside their respective traits. * Minimum required `rustc` is `1.35.0-nightly (2019-04-05)`. @@ -903,7 +903,7 @@ This release includes the following new features: * `&Route` is now a request guard. * The base mount path of a [`Route`] can be retrieved via `Route::base` or `Route::base()`. - * [`Cookies`] supports _private_ (authenticated encryption) cookies, encryped + * [`Cookies`] supports _private_ (authenticated encryption) cookies, encrypted with the `secret_key` config key. * `Config::{development, staging, production}` constructors were added for [`Config`]. @@ -1062,7 +1062,7 @@ applications. * **[`ContentType::from_extension()`] returns an `Option`.** - For the old behvavior, use `.unwrap_or(ContentType::Any)`. + For the old behavior, use `.unwrap_or(ContentType::Any)`. * **The `IntoValue` config trait was removed in favor of `Into`.** @@ -1095,7 +1095,7 @@ applications. In addition to new features, Rocket saw the following improvements: - * "Rocket" is now capatilized in the `Server` HTTP header. + * "Rocket" is now capitalized in the `Server` HTTP header. * The generic parameter of `rocket_contrib::Json` defaults to `json::Value`. * The trailing '...' in the launch message was removed. * The launch message prints regardless of the config environment. @@ -1475,7 +1475,7 @@ now implements its own `Request` and `Response` types. * `ContentType` uses associated constants instead of static methods. * `StatusCode` removed in favor of new `Status` type. - * `Response` type alias superceded by `Response` type. + * `Response` type alias superseded by `Response` type. * `Responder::respond` no longer takes in hyper type. * `Responder::respond` returns `Response`, takes `self` by move. * `Handler` returns `Outcome` instead of `Response` type alias. diff --git a/contrib/dyn_templates/src/lib.rs b/contrib/dyn_templates/src/lib.rs index d39653a7..4d3a64a5 100644 --- a/contrib/dyn_templates/src/lib.rs +++ b/contrib/dyn_templates/src/lib.rs @@ -49,7 +49,7 @@ //! //! Templates that are _not_ discovered by Rocket, such as those registered //! directly via [`Template::custom()`], are _not_ renamed. Use the name with -//! which the template was orginally registered. +//! which the template was originally registered. //! //! ## Content Type //! diff --git a/core/codegen/src/lib.rs b/core/codegen/src/lib.rs index 2d09f2bc..9cb71742 100644 --- a/core/codegen/src/lib.rs +++ b/core/codegen/src/lib.rs @@ -383,7 +383,7 @@ pub fn async_test(args: TokenStream, input: TokenStream) -> TokenStream { /// Retrofits `async fn` support in `main` functions. /// /// A `main` `async fn` function decorated with `#[rocket::main]` is transformed -/// into a regular `main` function that internally initalizes a Rocket-specific +/// into a regular `main` function that internally initializes a Rocket-specific /// tokio runtime and runs the attributed `async fn` inside of it: /// /// ```rust,no_run diff --git a/core/codegen/tests/from_form.rs b/core/codegen/tests/from_form.rs index d9e458a1..fec1d9c3 100644 --- a/core/codegen/tests/from_form.rs +++ b/core/codegen/tests/from_form.rs @@ -776,7 +776,7 @@ fn test_defaults() { let form2: Option = strict(&form_string).ok(); assert!(form2.is_none()); - // Ensure actual form field values take precendence. + // Ensure actual form field values take precedence. let form_string = &["field1=101", "field2=102", "field3=true", "field5=true"].join("&"); let form3: Option = lenient(&form_string).ok(); assert_eq!(form3, Some(FormWithDefaults { @@ -830,7 +830,7 @@ fn test_lazy_default() { missing3: usize, } - // Ensure actual form field values take precendence. + // Ensure actual form field values take precedence. let form_string = &["a=100", "b=300"].join("&"); let form3: Option = lenient(&form_string).ok(); assert_eq!(form3, Some(MyForm { diff --git a/core/lib/src/catcher/handler.rs b/core/lib/src/catcher/handler.rs index 6ba41ebb..96501401 100644 --- a/core/lib/src/catcher/handler.rs +++ b/core/lib/src/catcher/handler.rs @@ -13,7 +13,7 @@ pub type BoxFuture<'r, T = Result<'r>> = futures::future::BoxFuture<'r, T>; /// /// This trait is exactly like a [`Route`](crate::Route)'s /// [`Handler`](crate::route::Handler) except it handles errors instead of -/// requests. Thus, the documentaiton for +/// requests. Thus, the documentation for /// [`route::Handler`](crate::route::Handler) applies to this trait as well. We /// defer to it for full details. /// diff --git a/core/lib/src/error.rs b/core/lib/src/error.rs index 6f509806..1ce50334 100644 --- a/core/lib/src/error.rs +++ b/core/lib/src/error.rs @@ -213,7 +213,7 @@ impl Drop for Error { panic!("aborting due to fairing failure(s)"); } ErrorKind::Runtime(ref err) => { - error!("An error occured in the runtime:"); + error!("An error occurred in the runtime:"); info_!("{}", err); panic!("aborting due to runtime failure"); } diff --git a/core/lib/src/ext.rs b/core/lib/src/ext.rs index 2b7501f3..1dd6b504 100644 --- a/core/lib/src/ext.rs +++ b/core/lib/src/ext.rs @@ -139,7 +139,7 @@ enum State { Mercy(Pin>), /// We failed to shutdown and are force-closing the connection. Terminated, - /// We successfuly shutdown the connection. + /// We successfully shutdown the connection. Inactive, } diff --git a/core/lib/src/form/context.rs b/core/lib/src/form/context.rs index a2e2ca35..c0d84cc0 100644 --- a/core/lib/src/form/context.rs +++ b/core/lib/src/form/context.rs @@ -114,7 +114,7 @@ impl<'v> Context<'v> { /// `name`. /// /// The type of `name` may be `&Name`, `&str`, or `&RawStr`. Lookup is - /// case-sensitive but key-seperator (`.` or `[]`) insensitive. + /// case-sensitive but key-separator (`.` or `[]`) insensitive. /// /// # Example /// @@ -137,7 +137,7 @@ impl<'v> Context<'v> { /// `name`. /// /// The type of `name` may be `&Name`, `&str`, or `&RawStr`. Lookup is - /// case-sensitive but key-seperator (`.` or `[]`) insensitive. + /// case-sensitive but key-separator (`.` or `[]`) insensitive. /// /// # Example /// @@ -202,7 +202,7 @@ impl<'v> Context<'v> { /// their children: `a.b`'s errors apply to `a.b.c`, `a.b.d` and so on but /// not `a.c`. /// - /// Lookup is case-sensitive but key-seperator (`.` or `[]`) insensitive. + /// Lookup is case-sensitive but key-separator (`.` or `[]`) insensitive. /// /// # Example /// @@ -250,7 +250,7 @@ impl<'v> Context<'v> { /// errors associated with its chilren. Use [`Context::field_errors()`] in /// almost all cases. /// - /// Lookup is case-sensitive but key-seperator (`.` or `[]`) insensitive. + /// Lookup is case-sensitive but key-separator (`.` or `[]`) insensitive. /// /// # Example /// diff --git a/core/lib/src/form/error.rs b/core/lib/src/form/error.rs index a83e2b08..d7a23310 100644 --- a/core/lib/src/form/error.rs +++ b/core/lib/src/form/error.rs @@ -31,7 +31,7 @@ use crate::data::ByteUnit; /// let errors_for_foo = errors.iter().filter(|e| e.is_for("foo.bar")); /// ``` /// -/// ## Contructing +/// ## Contracting /// /// An `Errors` can be constructed from anything that an `Error` can be /// constructed from. This includes [`Error`], [`ErrorKind`], and all of the @@ -72,7 +72,7 @@ pub struct Errors<'v>(Vec>); /// [`FromFormField`]: crate::form::FromFormField /// [`validate`]: crate::form::validate /// -/// # Contructing +/// # Contracting /// /// An `Error` can be constructed via [`Error::validation()`], /// [`Error::custom()`], or anything that an [`ErrorKind`] can be constructed @@ -103,7 +103,7 @@ pub struct Errors<'v>(Vec>); /// automatically. /// /// When constructed from an `ErrorKind`, the entity is set to -/// [`Entity::default_for()`] by default. Ocassionally, the error's `entity` may +/// [`Entity::default_for()`] by default. Occasionally, the error's `entity` may /// need to be set manually. Return what would be useful to the end-consumer. /// /// # Matching Errors to Fields @@ -136,13 +136,13 @@ pub struct Error<'v> { pub name: Option>, /// The field's value, if it is known. pub value: Option>, - /// The kind of error that occured. + /// The kind of error that occurred. pub kind: ErrorKind<'v>, /// The entitiy that caused the error. pub entity: Entity, } -/// The kind of form error that occured. +/// The kind of form error that occurred. /// /// ## Constructing /// diff --git a/core/lib/src/form/form.rs b/core/lib/src/form/form.rs index 25367e83..e40a69b5 100644 --- a/core/lib/src/form/form.rs +++ b/core/lib/src/form/form.rs @@ -155,7 +155,7 @@ impl<'r, T: FromForm<'r>> Form { /// Leniently parses a `T` from a **percent-decoded** /// `x-www-form-urlencoded` form string. Specifically, this method /// implements [§5.1 of the WHATWG URL Living Standard] with the exception - /// of steps 3.4 and 3.5, which are assumed to already be relfected in + /// of steps 3.4 and 3.5, which are assumed to already be reflected in /// `string`, and then parses the fields as `T`. /// /// [§5.1 of the WHATWG URL Living Standard]: https://url.spec.whatwg.org/#application/x-www-form-urlencoded diff --git a/core/lib/src/form/from_form.rs b/core/lib/src/form/from_form.rs index cef4e26e..e1c61c24 100644 --- a/core/lib/src/form/from_form.rs +++ b/core/lib/src/form/from_form.rs @@ -75,7 +75,7 @@ use crate::http::uncased::AsUncased; /// /// Most type inherit their strategy on [`FromForm::init()`], but some types /// like `Option` override the requested strategy. The strategy can also be -/// overwritted manually, per-field or per-value, by using the [`Strict`] or +/// overwritten manually, per-field or per-value, by using the [`Strict`] or /// [`Lenient`] form guard: /// /// ```rust diff --git a/core/lib/src/fs/temp_file.rs b/core/lib/src/fs/temp_file.rs index c07930e3..c504ccb4 100644 --- a/core/lib/src/fs/temp_file.rs +++ b/core/lib/src/fs/temp_file.rs @@ -26,7 +26,7 @@ use either::Either; /// attempt is made not to delete temporary files in use, _detection_ of when a /// temporary file is being used is unreliable. As a result, a time-of-check to /// time-of-use race condition from the creation of a `TempFile` to the -/// persistance of the `TempFile` may occur. Specifically, the following +/// persistence of the `TempFile` may occur. Specifically, the following /// sequence may occur: /// /// 1. A `TempFile` is created at random path `foo`. diff --git a/core/lib/src/route/route.rs b/core/lib/src/route/route.rs index 618d5d1b..b136b82b 100644 --- a/core/lib/src/route/route.rs +++ b/core/lib/src/route/route.rs @@ -74,7 +74,7 @@ use crate::sentinel::Sentry; /// /// Collisions are resolved through _ranking_. Routes with lower ranks have /// higher precedence during routing than routes with higher ranks. Thus, routes -/// are attempted in ascending rank order. If a higher precendence route returns +/// are attempted in ascending rank order. If a higher precedence route returns /// an `Outcome` of `Forward`, the next highest precedence route is attempted, /// and so on, until a route returns `Success` or `Failure`, or there are no /// more routes to try. When all routes have been attempted, Rocket issues a diff --git a/core/lib/src/shield/policy.rs b/core/lib/src/shield/policy.rs index 1760c269..b63d5827 100644 --- a/core/lib/src/shield/policy.rs +++ b/core/lib/src/shield/policy.rs @@ -796,7 +796,7 @@ pub enum Feature { /// The "interest-cohort" feature. InterestCohort, - // Expiremental. + // Experimental. /// The "conversion-measurement" feature. ConversionMeasurement, diff --git a/site/guide/4-requests.md b/site/guide/4-requests.md index 7ef171f4..16f6ef21 100644 --- a/site/guide/4-requests.md +++ b/site/guide/4-requests.md @@ -999,7 +999,7 @@ struct Password<'r> { In reality, the expression after `validate =` can be _any_ expression as long as it evaluates to a value of type `Result<(), Errors<'_>>` (aliased by [`form::Result`]), where an `Ok` value means that validation was successful while -an `Err` of [`Errors<'_>`] indicates the error(s) that occured. For instance, if +an `Err` of [`Errors<'_>`] indicates the error(s) that occurred. For instance, if you wanted to implement an ad-hoc Luhn validator for credit-card-like numbers, you might write: