diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-08-01 03:16:42 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-08-01 05:34:55 -0400 |
| commit | 1fc4db2d086fd068a934c9ed2ccf25456fedc216 (patch) | |
| tree | 8e96cbc62b80bd622f78cf68b0bb29cb14ebc417 /src/libstd/str | |
| parent | 5f59c46e0f5605a0cc90ebdb26b4d258a8f7b43a (diff) | |
| download | rust-1fc4db2d086fd068a934c9ed2ccf25456fedc216.tar.gz rust-1fc4db2d086fd068a934c9ed2ccf25456fedc216.zip | |
migrate many `for` loops to `foreach`
Diffstat (limited to 'src/libstd/str')
| -rw-r--r-- | src/libstd/str/ascii.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/str/ascii.rs b/src/libstd/str/ascii.rs index 24e48dbe139..3f24f98bd3d 100644 --- a/src/libstd/str/ascii.rs +++ b/src/libstd/str/ascii.rs @@ -14,9 +14,10 @@ use to_str::{ToStr,ToStrConsume}; use str; use str::StrSlice; use cast; -use iterator::IteratorUtil; +use iterator::{Iterator, IteratorUtil}; use vec::{CopyableVector, ImmutableVector, OwnedVector}; use to_bytes::IterBytes; +use option::{Some, None}; /// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero. #[deriving(Clone, Eq)] @@ -93,7 +94,7 @@ impl<'self> AsciiCast<&'self[Ascii]> for &'self [u8] { #[inline] fn is_ascii(&self) -> bool { - for self.iter().advance |b| { + foreach b in self.iter() { if !b.is_ascii() { return false; } } true |
