about summary refs log tree commit diff
path: root/src/libstd/str.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/str.rs')
-rw-r--r--src/libstd/str.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index e581eff83ad..8cd69f32e49 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -1800,7 +1800,7 @@ impl<'self> StrSlice<'self> for &'self str {
      */
     #[inline]
     fn substr(&self, begin: uint, n: uint) -> &'self str {
-        s.slice(begin, begin + count_bytes(s, begin, n))
+        self.slice(begin, begin + count_bytes(*self, begin, n))
     }
     /// Escape each char in `s` with char::escape_default.
     #[inline]
@@ -2318,7 +2318,6 @@ impl<'self> Iterator<u8> for StrBytesRevIterator<'self> {
 mod tests {
     use iterator::IteratorUtil;
     use container::Container;
-    use char;
     use option::Some;
     use libc::c_char;
     use libc;
@@ -3027,14 +3026,6 @@ mod tests {
     }
 
     #[test]
-    fn test_chars() {
-        let ss = ~"ศไทย中华Việt Nam";
-        assert!(~['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a',
-                       'm']
-            == to_chars(ss));
-    }
-
-    #[test]
     fn test_utf16() {
         let pairs =
             [(~"𐍅𐌿𐌻𐍆𐌹𐌻𐌰\n",