Skip to content

Commit 4043c70

Browse files
author
blake2-ppc
committed
std::str: Small fix for slice
1 parent 548bdba commit 4043c70

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libstd/str.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,8 +1366,7 @@ impl<'self> StrSlice<'self> for &'self str {
13661366
/// beyond the last character of the string
13671367
#[inline]
13681368
fn slice(&self, begin: uint, end: uint) -> &'self str {
1369-
assert!(self.is_char_boundary(begin));
1370-
assert!(self.is_char_boundary(end));
1369+
assert!(self.is_char_boundary(begin) && self.is_char_boundary(end));
13711370
unsafe { raw::slice_bytes(*self, begin, end) }
13721371
}
13731372
@@ -1609,6 +1608,7 @@ impl<'self> StrSlice<'self> for &'self str {
16091608
16101609
/// Returns false if the index points into the middle of a multi-byte
16111610
/// character sequence.
1611+
#[inline]
16121612
fn is_char_boundary(&self, index: uint) -> bool {
16131613
if index == self.len() { return true; }
16141614
let b = self[index];
@@ -1694,6 +1694,7 @@ impl<'self> StrSlice<'self> for &'self str {
16941694
/// This function can be used to iterate over a unicode string in reverse.
16951695
///
16961696
/// Returns 0 for next index if called on start index 0.
1697+
#[inline]
16971698
fn char_range_at_reverse(&self, start: uint) -> CharRange {
16981699
let mut prev = start;
16991700

0 commit comments

Comments
 (0)