@@ -218,7 +218,7 @@ impl AsciiStr {
218
218
pub fn trim_start ( & self ) -> & Self {
219
219
let whitespace_len = self
220
220
. chars ( )
221
- . position ( |ascii | !ascii . is_whitespace ( ) )
221
+ . position ( |ch | !ch . is_whitespace ( ) )
222
222
. unwrap_or_else ( || self . len ( ) ) ;
223
223
224
224
// SAFETY: `whitespace_len` is `0..=len`, which is at most `len`, which is a valid empty slice.
@@ -239,7 +239,7 @@ impl AsciiStr {
239
239
let whitespace_len = self
240
240
. chars ( )
241
241
. rev ( )
242
- . position ( |ascii | !ascii . is_whitespace ( ) )
242
+ . position ( |ch | !ch . is_whitespace ( ) )
243
243
. unwrap_or_else ( || self . len ( ) ) ;
244
244
245
245
// SAFETY: `whitespace_len` is `0..=len`, which is at most `len`, which is a valid empty slice, and at least `0`, which is the whole slice.
@@ -655,7 +655,7 @@ impl<'a> Iterator for Split<'a> {
655
655
let start: & AsciiStr = self . chars . as_str ( ) ;
656
656
let split_on = self . on ;
657
657
658
- if let Some ( at) = self . chars . position ( |ascii| ascii == split_on) {
658
+ if let Some ( at) = self . chars . position ( |ch| ch == split_on) {
659
659
// SAFETY: `at` is guaranteed to be in bounds, as `position` returns `Ok(0..len)`.
660
660
Some ( unsafe { start. as_slice ( ) . get_unchecked ( ..at) . into ( ) } )
661
661
} else {
@@ -673,7 +673,7 @@ impl<'a> DoubleEndedIterator for Split<'a> {
673
673
let start: & AsciiStr = self . chars . as_str ( ) ;
674
674
let split_on = self . on ;
675
675
676
- if let Some ( at) = self . chars . rposition ( |ascii| ascii == split_on) {
676
+ if let Some ( at) = self . chars . rposition ( |ch| ch == split_on) {
677
677
// SAFETY: `at` is guaranteed to be in bounds, as `rposition` returns `Ok(0..len)`, and slices `1..`, `2..`, etc... until `len..` inclusive, are valid.
678
678
Some ( unsafe { start. as_slice ( ) . get_unchecked ( at + 1 ..) . into ( ) } )
679
679
} else {
@@ -743,7 +743,7 @@ impl<'a> DoubleEndedIterator for Lines<'a> {
743
743
. string
744
744
. chars ( )
745
745
. rev ( )
746
- . position ( |ascii| ascii == AsciiChar :: LineFeed )
746
+ . position ( |ch| ch == AsciiChar :: LineFeed )
747
747
. unwrap_or_else ( || self . string . len ( ) ) ;
748
748
749
749
// SAFETY: As per above, `self.len() - lf_rev_pos` will be in range `0..len - 1`, so both indexes are correct.
0 commit comments