Skip to content

Commit 0621f65

Browse files
committed
Simplify is_ascii condition in the same way as is done for &str
1 parent 43ffbd1 commit 0621f65

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/libstd/ascii.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,7 @@ impl<'a> AsciiCast<&'a[Ascii]> for &'a [u8] {
168168

169169
#[inline]
170170
fn is_ascii(&self) -> bool {
171-
for b in self.iter() {
172-
if !b.is_ascii() { return false; }
173-
}
174-
true
171+
self.iter().all(|b| b.is_ascii())
175172
}
176173
}
177174

0 commit comments

Comments
 (0)