@@ -197,7 +197,7 @@ impl AsciiStr {
197
197
/// assert_eq!("white \tspace \t", example.trim_start());
198
198
/// ```
199
199
pub fn trim_start ( & self ) -> & Self {
200
- & self [ self . chars ( ) . take_while ( |a| a . is_whitespace ( ) ) . count ( ) ..]
200
+ & self [ self . chars ( ) . take_while ( |ch| ch . is_whitespace ( ) ) . count ( ) ..]
201
201
}
202
202
203
203
/// Returns an ASCII string slice with trailing whitespace removed.
@@ -209,7 +209,11 @@ impl AsciiStr {
209
209
/// assert_eq!(" \twhite \tspace", example.trim_end());
210
210
/// ```
211
211
pub fn trim_end ( & self ) -> & Self {
212
- let trimmed = self . chars ( ) . rev ( ) . take_while ( |a| a. is_whitespace ( ) ) . count ( ) ;
212
+ let trimmed = self
213
+ . chars ( )
214
+ . rev ( )
215
+ . take_while ( |ch| ch. is_whitespace ( ) )
216
+ . count ( ) ;
213
217
& self [ ..self . len ( ) - trimmed]
214
218
}
215
219
@@ -219,20 +223,20 @@ impl AsciiStr {
219
223
&& self
220
224
. chars ( )
221
225
. zip ( other. chars ( ) )
222
- . all ( |( a , b ) | a . eq_ignore_ascii_case ( & b ) )
226
+ . all ( |( ch , other_ch ) | ch . eq_ignore_ascii_case ( & other_ch ) )
223
227
}
224
228
225
229
/// Replaces lowercase letters with their uppercase equivalent.
226
230
pub fn make_ascii_uppercase ( & mut self ) {
227
- for a in self . chars_mut ( ) {
228
- * a = a . to_ascii_uppercase ( ) ;
231
+ for ch in self . chars_mut ( ) {
232
+ * ch = ch . to_ascii_uppercase ( ) ;
229
233
}
230
234
}
231
235
232
236
/// Replaces uppercase letters with their lowercase equivalent.
233
237
pub fn make_ascii_lowercase ( & mut self ) {
234
- for a in self . chars_mut ( ) {
235
- * a = a . to_ascii_lowercase ( ) ;
238
+ for ch in self . chars_mut ( ) {
239
+ * ch = ch . to_ascii_lowercase ( ) ;
236
240
}
237
241
}
238
242
@@ -605,7 +609,7 @@ impl<'a> Iterator for Split<'a> {
605
609
if !self . ended {
606
610
let start: & AsciiStr = self . chars . as_str ( ) ;
607
611
let split_on = self . on ;
608
- if let Some ( at) = self . chars . position ( |c| c == split_on) {
612
+ if let Some ( at) = self . chars . position ( |ch| ch == split_on) {
609
613
Some ( & start[ ..at] )
610
614
} else {
611
615
self . ended = true ;
@@ -621,7 +625,7 @@ impl<'a> DoubleEndedIterator for Split<'a> {
621
625
if !self . ended {
622
626
let start: & AsciiStr = self . chars . as_str ( ) ;
623
627
let split_on = self . on ;
624
- if let Some ( at) = self . chars . rposition ( |c| c == split_on) {
628
+ if let Some ( at) = self . chars . rposition ( |ch| ch == split_on) {
625
629
Some ( & start[ at + 1 ..] )
626
630
} else {
627
631
self . ended = true ;
0 commit comments