diff --git a/src/byte_str.rs b/src/byte_str.rs index 181ced9e..90872ecb 100644 --- a/src/byte_str.rs +++ b/src/byte_str.rs @@ -31,7 +31,7 @@ impl ByteStr { /// /// ## Safety /// `bytes` must contain valid UTF-8. In a release build it is undefined - /// behaviour to call this with `bytes` that is not valid UTF-8. + /// behavior to call this with `bytes` that is not valid UTF-8. pub unsafe fn from_utf8_unchecked(bytes: Bytes) -> ByteStr { if cfg!(debug_assertions) { match str::from_utf8(&bytes) { diff --git a/src/extensions.rs b/src/extensions.rs index 3764a558..c41bbfc3 100644 --- a/src/extensions.rs +++ b/src/extensions.rs @@ -215,7 +215,7 @@ impl Extensions { self.map.as_ref().map_or(true, |map| map.is_empty()) } - /// Get the numer of extensions available. + /// Get the number of extensions available. /// /// # Example /// diff --git a/src/header/name.rs b/src/header/name.rs index 09af1da1..3d563f4e 100644 --- a/src/header/name.rs +++ b/src/header/name.rs @@ -1659,13 +1659,13 @@ const SCRATCH_BUF_OVERFLOW: usize = SCRATCH_BUF_SIZE + 1; fn uninit_u8_array() -> [MaybeUninit; SCRATCH_BUF_SIZE] { let arr = MaybeUninit::<[MaybeUninit; SCRATCH_BUF_SIZE]>::uninit(); // Safety: assume_init() is claiming that an array of MaybeUninit<> - // has been initilized, but MaybeUninit<>'s do not require initilizaton. + // has been initialized, but MaybeUninit<>'s do not require initialization. unsafe { arr.assume_init() } } -// Assuming all the elements are initilized, get a slice of them. +// Assuming all the elements are initialized, get a slice of them. // -// Safety: All elements of `slice` must be initilized to prevent +// Safety: All elements of `slice` must be initialized to prevent // undefined behavior. unsafe fn slice_assume_init(slice: &[MaybeUninit]) -> &[T] { &*(slice as *const [MaybeUninit] as *const [T]) diff --git a/src/uri/authority.rs b/src/uri/authority.rs index dab6dcd0..07aa6795 100644 --- a/src/uri/authority.rs +++ b/src/uri/authority.rs @@ -24,7 +24,7 @@ impl Authority { // Not public while `bytes` is unstable. pub(super) fn from_shared(s: Bytes) -> Result { // Precondition on create_authority: trivially satisfied by the - // identity clousre + // identity closure create_authority(s, |s| s) } diff --git a/src/uri/scheme.rs b/src/uri/scheme.rs index c33ec41a..dbcc8c3f 100644 --- a/src/uri/scheme.rs +++ b/src/uri/scheme.rs @@ -302,7 +302,7 @@ impl Scheme2 { // Return scheme return Ok(Scheme2::Other(i)); } - // Invald scheme character, abort + // Invalid scheme character, abort 0 => break, _ => {} } @@ -349,10 +349,10 @@ mod test { #[test] fn invalid_scheme_is_error() { - Scheme::try_from("my_funky_scheme").expect_err("Unexpectly valid Scheme"); + Scheme::try_from("my_funky_scheme").expect_err("Unexpectedly valid Scheme"); // Invalid UTF-8 - Scheme::try_from([0xC0].as_ref()).expect_err("Unexpectly valid Scheme"); + Scheme::try_from([0xC0].as_ref()).expect_err("Unexpectedly valid Scheme"); } fn scheme(s: &str) -> Scheme {