diff options
| author | Alfie John <alfiej@fastmail.fm> | 2015-01-22 14:08:56 +0000 |
|---|---|---|
| committer | Alfie John <alfiej@fastmail.fm> | 2015-01-25 00:17:41 +0000 |
| commit | f67e7470b31a38e80c9f1007e4182ff5b56db2f7 (patch) | |
| tree | 20f875e1138930df63de91297fbef3bd7cff01e4 /src/libcore/str | |
| parent | bb7cc4eb26e87ec4cb2acdc5bc3a7d25b9c817be (diff) | |
| download | rust-f67e7470b31a38e80c9f1007e4182ff5b56db2f7.tar.gz rust-f67e7470b31a38e80c9f1007e4182ff5b56db2f7.zip | |
Moving away from deprecated i/u suffixes in libcore
Diffstat (limited to 'src/libcore/str')
| -rw-r--r-- | src/libcore/str/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 1e01da4e41d..b0227c749cc 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -198,9 +198,9 @@ pub unsafe fn from_utf8_unchecked<'a>(v: &'a [u8]) -> &'a str { #[deprecated = "use std::ffi::c_str_to_bytes + str::from_utf8"] pub unsafe fn from_c_str(s: *const i8) -> &'static str { let s = s as *const u8; - let mut len = 0u; + let mut len = 0; while *s.offset(len as int) != 0 { - len += 1u; + len += 1; } let v: &'static [u8] = ::mem::transmute(Slice { data: s, len: len }); from_utf8(v).ok().expect("from_c_str passed invalid utf-8 data") @@ -1510,7 +1510,7 @@ impl StrExt for str { None => "", Some(last) => { let next = self.char_range_at(last).next; - unsafe { self.slice_unchecked(0u, next) } + unsafe { self.slice_unchecked(0, next) } } } } @@ -1543,7 +1543,7 @@ impl StrExt for str { fn multibyte_char_range_at_reverse(s: &str, mut i: uint) -> CharRange { // while there is a previous byte == 10...... while i > 0 && s.as_bytes()[i] & !CONT_MASK == TAG_CONT_U8 { - i -= 1u; + i -= 1; } let mut val = s.as_bytes()[i] as u32; @@ -1613,7 +1613,7 @@ impl StrExt for str { if self.is_empty() { None } else { - let CharRange {ch, next} = self.char_range_at(0u); + let CharRange {ch, next} = self.char_range_at(0); let next_s = unsafe { self.slice_unchecked(next, self.len()) }; Some((ch, next_s)) } |
