Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos. #2471

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/db_pools/lib/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub struct Initializer<D: Database>(Option<&'static str>, PhantomData<fn() -> D>
/// status `InternalServerError`. A [`Sentinel`] guards this condition, and so
/// this type of failure is unlikely to occur. A `None` error is returned.
/// * If a connection is not available within `connect_timeout` seconds or
/// another error occurs, the gaurd _fails_ with status `ServiceUnavailable`
/// another error occurs, the guard _fails_ with status `ServiceUnavailable`
/// and the error is returned in `Some`.
///
/// ## Deref
Expand Down
2 changes: 1 addition & 1 deletion contrib/db_pools/lib/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::fmt;
/// guard.
#[derive(Debug)]
pub enum Error<A, B = A> {
/// An error that occured during database/pool initialization.
/// An error that occurred during database/pool initialization.
Init(A),

/// An error that ocurred while retrieving a connection from the pool.
Expand Down
4 changes: 2 additions & 2 deletions contrib/db_pools/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
//!
//! ## Driver Defaults
//!
//! Some drivers provide configuration defaults different from the underyling
//! Some drivers provide configuration defaults different from the underlying
//! database's defaults. A best-effort attempt is made to document those
//! differences below:
//!
Expand All @@ -216,7 +216,7 @@
//!
//! # Extending
//!
//! Any database driver can implement support for this libary by implementing
//! Any database driver can implement support for this library by implementing
//! the [`Pool`] trait.

#![doc(html_root_url = "https://api.rocket.rs/master/rocket_db_pools")]
Expand Down
2 changes: 1 addition & 1 deletion contrib/db_pools/lib/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ use {std::time::Duration, crate::{Error, Config}};
/// // `InitError` to `Error<InitError, _>` with `Error::Init`.
/// let pool = MyPool::new(config).map_err(Error::Init)?;
///
/// // Return the fully intialized pool.
/// // Return the fully initialized pool.
/// Ok(pool)
/// }
///
Expand Down
2 changes: 1 addition & 1 deletion contrib/sync_db_pools/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
//! The list below includes all presently supported database adapters and their
//! corresponding [`Poolable`] type.
//!
// Note: Keep this table in sync with site/guite/6-state.md
// Note: Keep this table in sync with site/guide/6-state.md
//! | Kind | Driver | Version | `Poolable` Type | Feature |
//! |----------|-----------------------|-----------|--------------------------------|------------------------|
//! | Sqlite | [Diesel] | `2` | [`diesel::SqliteConnection`] | `diesel_sqlite_pool` |
Expand Down
6 changes: 3 additions & 3 deletions core/codegen/src/attribute/route/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ fn sentinels_expr(route: &Route) -> TokenStream {
.map(|p| &p.ident)
.collect();

// Note: for a given route, we need to emit a valid graph of eligble
// Note: for a given route, we need to emit a valid graph of eligible
// sentinels. This means that we don't have broken links, where a child
// points to a parent that doesn't exist. The concern is that the
// `is_concrete()` filter will cause a break in the graph.
Expand All @@ -268,12 +268,12 @@ fn sentinels_expr(route: &Route) -> TokenStream {
// 1. if `is_concrete()` returns `false` for a (valid) type, it returns
// false for all of its parents. we consider this an axiom; this is
// the point of `is_concrete()`. the type is filtered out, so the
// theorem vacously holds
// theorem vacuously holds
// 2. if `is_concrete()` returns `true`, for a type `T`, it either:
// * returns `false` for the parent. by 1) it will return false for
// _all_ parents of the type, so no node in the graph can consider,
// directly or indirectly, `T` to be a child, and thus there are no
// broken links; the thereom holds
// broken links; the theorem holds
// * returns `true` for the parent, and so the type has a parent, and
// the theorem holds.
// 3. these are all the cases. QED.
Expand Down
2 changes: 1 addition & 1 deletion core/codegen/src/bang/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn uri_macro(input: proc_macro::TokenStream) -> TokenStream {

pub fn uri_internal_macro(input: proc_macro::TokenStream) -> TokenStream {
// TODO: Ideally we would generate a perfect `Origin::ROOT` so that we don't
// assist in propoagate further errors. Alas, we can't set the span to the
// assist in propagate further errors. Alas, we can't set the span to the
// invocation of `uri!` without access to `span.parent()`, and
// `Span::call_site()` here points to the `#[route]`, immediate caller,
// generating a rather confusing error message when there's a type-mismatch.
Expand Down
4 changes: 2 additions & 2 deletions core/codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ pub fn derive_responder(input: TokenStream) -> TokenStream {
/// used. In the example above, the field `MyStruct::kind` is rendered with a
/// name of `type`.
///
/// The attribute can slso be applied to variants of C-like enums; it may only
/// The attribute can also be applied to variants of C-like enums; it may only
/// contain `value` and looks as follows:
///
/// ```rust
Expand Down Expand Up @@ -1230,7 +1230,7 @@ pub fn catchers(input: TokenStream) -> TokenStream {
/// A URI to a route name `foo` is generated using `uri!(foo(v1, v2, v3))` or
/// `uri!(foo(a = v1, b = v2, c = v3))`, where `v1`, `v2`, `v3` are the values
/// to fill in for route parameters named `a`, `b`, and `c`. If the named
/// parameter sytnax is used (`a = v1`, etc.), parameters can appear in any
/// parameter syntax is used (`a = v1`, etc.), parameters can appear in any
/// order.
///
/// More concretely, for the route `person` defined below:
Expand Down
2 changes: 1 addition & 1 deletion core/codegen/tests/from_form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ fn form_validate_error_return_correct_field_name() {
name: String,
check: bool,
// in the error context this is returned as "name" but should be "other"
// the problem is dependednt on an argument exsiting for evaluate_other
// the problem is dependent on an argument existing for evaluate_other
#[field(validate = evaluate_other(&self.check))]
other: String,
}
Expand Down
2 changes: 1 addition & 1 deletion core/http/src/header/content_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ macro_rules! parse_flexible {
($($short:expr => $name:ident,)*) => (
docify!([
Flexibly parses @code{name} into a @code{ContentType}. The parse is
@[_flexible_] because, in addition to stricly correct content types, it
@[_flexible_] because, in addition to strictly correct content types, it
recognizes the following shorthands:

@nl
Expand Down
2 changes: 1 addition & 1 deletion core/http/src/header/media_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ macro_rules! parse_flexible {
($($short:expr => $name:ident,)*) => (
docify!([
Flexibly parses @code{name} into a @code{MediaType}. The parse is
@[_flexible_] because, in addition to stricly correct media types, it
@[_flexible_] because, in addition to strictly correct media types, it
recognizes the following shorthands:

@nl
Expand Down
2 changes: 1 addition & 1 deletion core/http/src/parse/indexed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl AsPtr for [u8] {
pub enum Indexed<'a, T: ?Sized + ToOwned> {
/// The start and end index of a string.
Indexed(usize, usize),
/// A conrete string.
/// A concrete string.
Concrete(Cow<'a, T>)
}

Expand Down
2 changes: 1 addition & 1 deletion core/http/src/raw_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::uncased::UncasedStr;

/// A reference to a string inside of a raw HTTP message.
///
/// A `RawStr` is an unsanitzed, unvalidated, and undecoded raw string from an
/// A `RawStr` is an unsanitized, unvalidated, and undecoded raw string from an
/// HTTP message. It exists to separate validated string inputs, represented by
/// the `String`, `&str`, and `Cow<str>` types, from unvalidated inputs,
/// represented by `&RawStr`.
Expand Down
6 changes: 3 additions & 3 deletions core/http/src/tls/mtls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl<'a> Certificate<'a> {
self.inner().version.0
}

/// Returns the subject (a "DN" or "Distinguised Name") of the X.509
/// Returns the subject (a "DN" or "Distinguished Name") of the X.509
/// certificate.
///
/// # Example
Expand All @@ -285,7 +285,7 @@ impl<'a> Certificate<'a> {
Name::ref_cast(&self.inner().subject)
}

/// Returns the issuer (a "DN" or "Distinguised Name") of the X.509
/// Returns the issuer (a "DN" or "Distinguished Name") of the X.509
/// certificate.
///
/// # Example
Expand Down Expand Up @@ -446,7 +446,7 @@ impl<'a> Name<'a> {
/// `self`.
///
/// Note that email addresses need not be UTF-8 strings, or strings at all.
/// This method filters the email addresss in `self` to those that are. Use
/// This method filters the email addresses in `self` to those that are. Use
/// the raw [`iter_email()`](#method.iter_email) to iterate over all value
/// types.
///
Expand Down
6 changes: 3 additions & 3 deletions core/http/src/uri/fmt/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::uri::fmt::{UriDisplay, Part, Path, Query, Kind};
///
/// * When **nested named values** are written, typically by passing a value
/// to [`write_named_value()`] whose implementation of `UriDisplay` also
/// calls `write_named_vlaue()`, the nested names are joined by a `.`,
/// calls `write_named_value()`, the nested names are joined by a `.`,
/// written out followed by a `=`, followed by the value.
///
/// # Usage
Expand Down Expand Up @@ -433,7 +433,7 @@ impl<'a> ValidRoutePrefix for Origin<'a> {
type Output = Self;

fn append(self, path: Cow<'static, str>, query: Option<Cow<'static, str>>) -> Self::Output {
// No-op if `self` is already normalzied.
// No-op if `self` is already normalized.
let mut prefix = self.into_normalized();
prefix.clear_query();

Expand All @@ -454,7 +454,7 @@ impl<'a> ValidRoutePrefix for Absolute<'a> {
type Output = Self;

fn append(self, path: Cow<'static, str>, query: Option<Cow<'static, str>>) -> Self::Output {
// No-op if `self` is already normalzied.
// No-op if `self` is already normalized.
let mut prefix = self.into_normalized();
prefix.clear_query();

Expand Down
6 changes: 3 additions & 3 deletions core/http/src/uri/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::uri::{Absolute, Authority};
/// In HTTP/2 and HTTP/3, this information is instead communicated via the
/// `:authority` and `:port` pseudo-header request fields. It is a
/// client-controlled value via which the client communicates to the server the
/// domain name and port it is attemping to communicate with. The following
/// domain name and port it is attempting to communicate with. The following
/// diagram illustrates the syntactic structure of a `Host`:
///
/// ```text
Expand Down Expand Up @@ -113,7 +113,7 @@ impl<'a> Host<'a> {

/// Parses the string `string` into a `Host`. Parsing will never allocate.
/// Returns an `Error` if `string` is not a valid authority URI, meaning
/// that this parser accepts a `user_info` part for compatability but
/// that this parser accepts a `user_info` part for compatibility but
/// discards it.
///
/// # Example
Expand Down Expand Up @@ -156,7 +156,7 @@ impl<'a> Host<'a> {
/// This method should be used instead of [`Host::parse()`] when the source
/// is already a `String`. Returns an `Error` if `string` is not a valid
/// authority URI, meaning that this parser accepts a `user_info` part for
/// compatability but discards it.
/// compatibility but discards it.
///
/// # Example
///
Expand Down
2 changes: 1 addition & 1 deletion core/http/src/uri/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ impl<'a> Reference<'a> {
self.path = Data::new(path.into());
}

/// Returns the conrete path and query.
/// Returns the concrete path and query.
pub(crate) fn with_query_fragment_of(mut self, other: Reference<'a>) -> Self {
if let Some(query) = other.query {
if self.query().is_none() {
Expand Down
6 changes: 3 additions & 3 deletions core/http/src/uri/uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::uri::error::{Error, TryFromUriError};
///
/// In Rocket, this type will rarely be used directly. Instead, you will
/// typically encounter URIs via the [`Origin`] type. This is because all
/// incoming requests accepred by Rocket contain URIs in origin-form.
/// incoming requests accepted by Rocket contain URIs in origin-form.
///
/// ## Parsing
///
Expand Down Expand Up @@ -55,7 +55,7 @@ impl<'a> Uri<'a> {
/// [`Absolute`], or [`Reference`]. Parsing never allocates. Returns an
/// `Error` if `string` is not a valid URI of kind `T`.
///
/// To perform an ambgiuous parse into _any_ valid URI type, use
/// To perform an ambiguous parse into _any_ valid URI type, use
/// [`Uri::parse_any()`].
///
/// # Example
Expand Down Expand Up @@ -89,7 +89,7 @@ impl<'a> Uri<'a> {
///
/// Always prefer to use `uri!()` for statically known inputs.
///
/// Because URI parsing is ambgious (that is, there isn't a one-to-one
/// Because URI parsing is ambiguous (that is, there isn't a one-to-one
/// mapping between strings and a URI type), the internal type returned by
/// this method _may_ not be the desired type. This method chooses the "best
/// fit" type for a given string by preferring to parse in the following
Expand Down
4 changes: 2 additions & 2 deletions core/lib/src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use crate::config::SecretKey;
/// * **Metadata**
///
/// This provider is named `Rocket Config`. It does not specify a
/// [`Source`](figment::Source) and uses default interpolatation.
/// [`Source`](figment::Source) and uses default interpolation.
///
/// * **Data**
///
Expand Down Expand Up @@ -391,7 +391,7 @@ impl Config {
launch_meta_!("log level: {}", bold(self.log_level));
launch_meta_!("cli colors: {}", bold(&self.cli_colors));

// Check for now depreacted config values.
// Check for now deprecated config values.
for (key, replacement) in Self::DEPRECATED_KEYS {
if let Some(md) = figment.find_metadata(key) {
warn!("found value for deprecated config key `{}`", Paint::white(key));
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/config/shutdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl fmt::Display for Sig {
/// # }
/// ```
///
/// Or, as with all configuration options, programatically:
/// Or, as with all configuration options, programmatically:
///
/// ```rust
/// # use rocket::figment::{Figment, providers::{Format, Toml}};
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/config/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ impl TlsConfig {
/// let tls_config = TlsConfig::from_bytes(certs_buf, key_buf);
/// assert!(!tls_config.prefer_server_cipher_order());
///
/// // Which can be overriden with the eponymous builder method.
/// // Which can be overridden with the eponymous builder method.
/// let tls_config = TlsConfig::from_bytes(certs_buf, key_buf)
/// .with_preferred_server_cipher_order(true);
///
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/data/data_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl<'r> DataStream<'r> {
/// A helper method to write the body of the request to any `AsyncWrite`
/// type. Returns an [`N`] which indicates how many bytes were written and
/// whether the entire stream was read. An additional read from `self` may
/// be required to check if all of the sream has been read. If that
/// be required to check if all of the stream has been read. If that
/// information is not needed, use [`DataStream::stream_precise_to()`].
///
/// This method is identical to `tokio::io::copy(&mut self, &mut writer)`
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{Rocket, Orbit};
/// An error that occurs during launch.
///
/// An `Error` is returned by [`launch()`](Rocket::launch()) when launching an
/// application fails or, more rarely, when the runtime fails after lauching.
/// application fails or, more rarely, when the runtime fails after launching.
///
/// # Panics
///
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/fairing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ pub trait Fairing: Send + Sync + Any + 'static {
///
/// This method is called just after launching the application if
/// `Kind::Liftoff` is in the `kind` field of the `Info` structure for this
/// fairing. The `Rocket` parameter corresponds to the lauched application.
/// fairing. The `Rocket` parameter corresponds to the launched application.
///
/// ## Default Implementation
///
Expand Down
4 changes: 2 additions & 2 deletions core/lib/src/form/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl<'v> Context<'v> {
/// whose associated field name is _exactly_ `name` to be an error for the
/// field named `name`. This is _not_ what is typically desired as it
/// ignores errors that occur in the parent which will result in missing
/// errors associated with its chilren. Use [`Context::field_errors()`] in
/// errors associated with its children. Use [`Context::field_errors()`] in
/// almost all cases.
///
/// Lookup is case-sensitive but key-separator (`.` or `[]`) insensitive.
Expand All @@ -265,7 +265,7 @@ impl<'v> Context<'v> {
/// let id = form.context.exact_field_errors("id");
///
/// // Get all errors exactly for `foo.bar`. If `foo` failed, we will
/// // this will return no erorrs. Use `Context::field_errors()`.
/// // this will return no errors. Use `Context::field_errors()`.
/// let foo_bar = form.context.exact_field_errors("foo.bar");
/// }
/// ```
Expand Down
6 changes: 3 additions & 3 deletions core/lib/src/form/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub struct Error<'v> {
pub value: Option<Cow<'v, str>>,
/// The kind of error that occurred.
pub kind: ErrorKind<'v>,
/// The entitiy that caused the error.
/// The entity that caused the error.
pub entity: Entity,
}

Expand Down Expand Up @@ -167,7 +167,7 @@ pub enum ErrorKind<'v> {
InvalidLength {
/// The minimum length required, inclusive.
min: Option<u64>,
/// The maximum length required, inclusize.
/// The maximum length required, inclusive.
max: Option<u64>,
},
/// The value wasn't one of the valid `choices`.
Expand Down Expand Up @@ -210,7 +210,7 @@ pub enum ErrorKind<'v> {
Io(io::Error),
}

/// The erranous form entity or form component.
/// The erroneous form entity or form component.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Entity {
/// The form itself.
Expand Down
4 changes: 2 additions & 2 deletions core/lib/src/form/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl<'v> ValueField<'v> {
ValueField::from(("", value))
}

/// Shift the `name` of `self` and return `self` with the shfited `name`.
/// Shift the `name` of `self` and return `self` with the shifted `name`.
///
/// See [`NameView::shift()`] for the details on name "shifting".
///
Expand Down Expand Up @@ -140,7 +140,7 @@ impl<'v> ValueField<'v> {
.with_entity(Entity::ValueField)
}

/// Creates a complete mising value field [`Error`] from `self`.
/// Creates a complete missing value field [`Error`] from `self`.
///
/// The error will have the following properties:
/// * `kind`: [`ErrorKind::Missing`]
Expand Down
Loading