about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorblake2-ppc <blake2-ppc>2013-08-18 13:57:34 +0200
committerblake2-ppc <blake2-ppc>2013-08-19 11:19:59 +0200
commit4043c70f23bbc883088634e9cf0c3224524a2c5c (patch)
tree5c210d0232d7b0b0ddf87b6c61c4a3f57a5d4491 /src/libstd
parent548bdbaa29e0855a87ac5eec073d83babb72d8f2 (diff)
std::str: Small fix for slice
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/str.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index 3d793bc8e77..07006ba8c15 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -1366,8 +1366,7 @@ impl<'self> StrSlice<'self> for &'self str {
     /// beyond the last character of the string
     #[inline]
     fn slice(&self, begin: uint, end: uint) -> &'self str {
-        assert!(self.is_char_boundary(begin));
-        assert!(self.is_char_boundary(end));
+        assert!(self.is_char_boundary(begin) && self.is_char_boundary(end));
         unsafe { raw::slice_bytes(*self, begin, end) }
     }
 
@@ -1609,6 +1608,7 @@ impl<'self> StrSlice<'self> for &'self str {
 
     /// Returns false if the index points into the middle of a multi-byte
     /// character sequence.
+    #[inline]
     fn is_char_boundary(&self, index: uint) -> bool {
         if index == self.len() { return true; }
         let b = self[index];
@@ -1694,6 +1694,7 @@ impl<'self> StrSlice<'self> for &'self str {
     /// This function can be used to iterate over a unicode string in reverse.
     ///
     /// Returns 0 for next index if called on start index 0.
+    #[inline]
     fn char_range_at_reverse(&self, start: uint) -> CharRange {
         let mut prev = start;