File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ impl ByteStr {
31
31
///
32
32
/// ## Safety
33
33
/// `bytes` must contain valid UTF-8. In a release build it is undefined
34
- /// behaviour to call this with `bytes` that is not valid UTF-8.
34
+ /// behavior to call this with `bytes` that is not valid UTF-8.
35
35
pub unsafe fn from_utf8_unchecked ( bytes : Bytes ) -> ByteStr {
36
36
if cfg ! ( debug_assertions) {
37
37
match str:: from_utf8 ( & bytes) {
Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ impl Extensions {
215
215
self . map . as_ref ( ) . map_or ( true , |map| map. is_empty ( ) )
216
216
}
217
217
218
- /// Get the numer of extensions available.
218
+ /// Get the number of extensions available.
219
219
///
220
220
/// # Example
221
221
///
Original file line number Diff line number Diff line change @@ -1659,13 +1659,13 @@ const SCRATCH_BUF_OVERFLOW: usize = SCRATCH_BUF_SIZE + 1;
1659
1659
fn uninit_u8_array ( ) -> [ MaybeUninit < u8 > ; SCRATCH_BUF_SIZE ] {
1660
1660
let arr = MaybeUninit :: < [ MaybeUninit < u8 > ; SCRATCH_BUF_SIZE ] > :: uninit ( ) ;
1661
1661
// Safety: assume_init() is claiming that an array of MaybeUninit<>
1662
- // has been initilized , but MaybeUninit<>'s do not require initilizaton .
1662
+ // has been initialized , but MaybeUninit<>'s do not require initialization .
1663
1663
unsafe { arr. assume_init ( ) }
1664
1664
}
1665
1665
1666
- // Assuming all the elements are initilized , get a slice of them.
1666
+ // Assuming all the elements are initialized , get a slice of them.
1667
1667
//
1668
- // Safety: All elements of `slice` must be initilized to prevent
1668
+ // Safety: All elements of `slice` must be initialized to prevent
1669
1669
// undefined behavior.
1670
1670
unsafe fn slice_assume_init < T > ( slice : & [ MaybeUninit < T > ] ) -> & [ T ] {
1671
1671
& * ( slice as * const [ MaybeUninit < T > ] as * const [ T ] )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ impl Authority {
24
24
// Not public while `bytes` is unstable.
25
25
pub ( super ) fn from_shared ( s : Bytes ) -> Result < Self , InvalidUri > {
26
26
// Precondition on create_authority: trivially satisfied by the
27
- // identity clousre
27
+ // identity closure
28
28
create_authority ( s, |s| s)
29
29
}
30
30
Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ impl Scheme2<usize> {
302
302
// Return scheme
303
303
return Ok ( Scheme2 :: Other ( i) ) ;
304
304
}
305
- // Invald scheme character, abort
305
+ // Invalid scheme character, abort
306
306
0 => break ,
307
307
_ => { }
308
308
}
@@ -349,10 +349,10 @@ mod test {
349
349
350
350
#[ test]
351
351
fn invalid_scheme_is_error ( ) {
352
- Scheme :: try_from ( "my_funky_scheme" ) . expect_err ( "Unexpectly valid Scheme" ) ;
352
+ Scheme :: try_from ( "my_funky_scheme" ) . expect_err ( "Unexpectedly valid Scheme" ) ;
353
353
354
354
// Invalid UTF-8
355
- Scheme :: try_from ( [ 0xC0 ] . as_ref ( ) ) . expect_err ( "Unexpectly valid Scheme" ) ;
355
+ Scheme :: try_from ( [ 0xC0 ] . as_ref ( ) ) . expect_err ( "Unexpectedly valid Scheme" ) ;
356
356
}
357
357
358
358
fn scheme ( s : & str ) -> Scheme {
You can’t perform that action at this time.
0 commit comments