]> git.lizzy.rs Git - rust.git/blobdiff - src/libcollections/str.rs
Fallout from stabilization.
[rust.git] / src / libcollections / str.rs
index 94554fd1e81db991d41d48a2ee2e9187004ded98..6608d0ee9a7ec92ddab020fbbb3a17e6f2988dc7 100644 (file)
@@ -752,21 +752,15 @@ fn lines_any(&self) -> LinesAny {
 
     /// Deprecated: use `s[a .. b]` instead.
     #[deprecated = "use slice notation [a..b] instead"]
-    fn slice(&self, begin: uint, end: uint) -> &str {
-        core_str::StrExt::slice(&self[], begin, end)
-    }
+    fn slice(&self, begin: uint, end: uint) -> &str;
 
     /// Deprecated: use `s[a..]` instead.
     #[deprecated = "use slice notation [a..] instead"]
-    fn slice_from(&self, begin: uint) -> &str {
-        core_str::StrExt::slice_from(&self[], begin)
-    }
+    fn slice_from(&self, begin: uint) -> &str;
 
     /// Deprecated: use `s[..a]` instead.
     #[deprecated = "use slice notation [..a] instead"]
-    fn slice_to(&self, end: uint) -> &str {
-        core_str::StrExt::slice_to(&self[], end)
-    }
+    fn slice_to(&self, end: uint) -> &str;
 
     /// Returns a slice of the string from the character range
     /// [`begin`..`end`).
@@ -1304,7 +1298,19 @@ fn trim_right(&self) -> &str {
 }
 
 #[stable]
-impl StrExt for str {}
+impl StrExt for str {
+    fn slice(&self, begin: uint, end: uint) -> &str {
+        &self[begin..end]
+    }
+
+    fn slice_from(&self, begin: uint) -> &str {
+        &self[begin..]
+    }
+
+    fn slice_to(&self, end: uint) -> &str {
+        &self[..end]
+    }
+}
 
 #[cfg(test)]
 mod tests {