Files
rust/src/libstd
blake2-ppc b656bfaaa9 std::str: Remove functions count_chars, count_bytes
These are very easy to replace with methods on string slices, basically
`.char_len()` and `.len()`.

These are the replacement implementations I did to clean these
functions up, but seeing this I propose removal:

/// ...
pub fn count_chars(s: &str, begin: uint, end: uint) -> uint {
    // .slice() checks the char boundaries
    s.slice(begin, end).char_len()
}

/// Counts the number of bytes taken by the first `n` chars in `s`
/// starting from byte index `begin`.
///
/// Fails if there are less than `n` chars past `begin`
pub fn count_bytes<'b>(s: &'b str, begin: uint, n: uint) -> uint {
    s.slice_from(begin).slice_chars(0, n).len()
}
2013-08-29 15:51:39 +02:00
..
2013-08-27 18:47:57 -07:00
2013-08-09 14:28:14 +09:00
2013-08-09 16:45:50 -07:00
2013-08-26 19:25:53 -04:00
2013-08-15 02:52:55 +02:00
2013-08-26 22:15:32 +09:00
2013-08-15 21:12:34 -04:00
2013-08-26 22:15:45 +09:00
2013-08-27 13:18:57 -04:00
2013-08-26 19:25:53 -04:00
2013-08-22 20:02:20 -07:00
2013-08-27 20:46:43 -07:00
2013-08-26 19:25:53 -04:00
2013-08-18 08:28:04 +10:00
2013-08-26 19:25:53 -04:00