Skip to content

Commit 9c2c6af

Browse files
committed
Changed closure arguments from |ascii| ... to |ch| ... to match with master
1 parent 7ba1891 commit 9c2c6af

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ascii_str.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl AsciiStr {
218218
pub fn trim_start(&self) -> &Self {
219219
let whitespace_len = self
220220
.chars()
221-
.position(|ascii| !ascii.is_whitespace())
221+
.position(|ch| !ch.is_whitespace())
222222
.unwrap_or_else(|| self.len());
223223

224224
// SAFETY: `whitespace_len` is `0..=len`, which is at most `len`, which is a valid empty slice.
@@ -239,7 +239,7 @@ impl AsciiStr {
239239
let whitespace_len = self
240240
.chars()
241241
.rev()
242-
.position(|ascii| !ascii.is_whitespace())
242+
.position(|ch| !ch.is_whitespace())
243243
.unwrap_or_else(|| self.len());
244244

245245
// 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> {
655655
let start: &AsciiStr = self.chars.as_str();
656656
let split_on = self.on;
657657

658-
if let Some(at) = self.chars.position(|ascii| ascii == split_on) {
658+
if let Some(at) = self.chars.position(|ch| ch == split_on) {
659659
// SAFETY: `at` is guaranteed to be in bounds, as `position` returns `Ok(0..len)`.
660660
Some(unsafe { start.as_slice().get_unchecked(..at).into() })
661661
} else {
@@ -673,7 +673,7 @@ impl<'a> DoubleEndedIterator for Split<'a> {
673673
let start: &AsciiStr = self.chars.as_str();
674674
let split_on = self.on;
675675

676-
if let Some(at) = self.chars.rposition(|ascii| ascii == split_on) {
676+
if let Some(at) = self.chars.rposition(|ch| ch == split_on) {
677677
// SAFETY: `at` is guaranteed to be in bounds, as `rposition` returns `Ok(0..len)`, and slices `1..`, `2..`, etc... until `len..` inclusive, are valid.
678678
Some(unsafe { start.as_slice().get_unchecked(at + 1..).into() })
679679
} else {
@@ -743,7 +743,7 @@ impl<'a> DoubleEndedIterator for Lines<'a> {
743743
.string
744744
.chars()
745745
.rev()
746-
.position(|ascii| ascii == AsciiChar::LineFeed)
746+
.position(|ch| ch == AsciiChar::LineFeed)
747747
.unwrap_or_else(|| self.string.len());
748748

749749
// SAFETY: As per above, `self.len() - lf_rev_pos` will be in range `0..len - 1`, so both indexes are correct.

0 commit comments

Comments
 (0)