about summary refs log tree commit diff
path: root/src/libstd/path/mod.rs
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-10-02 11:48:07 -0700
committerAaron Turon <aturon@mozilla.com>2014-10-02 11:48:07 -0700
commitd2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7 (patch)
treed39de6be5866c0f0f37f9f3219b8217c873d8b52 /src/libstd/path/mod.rs
parentc0c6c895890770d7029324fd9b592f42e0564e8b (diff)
downloadrust-d2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7.tar.gz
rust-d2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7.zip
Revert "Use slice syntax instead of slice_to, etc."
This reverts commit 40b9f5ded50ac4ce8c9323921ec556ad611af6b7.
Diffstat (limited to 'src/libstd/path/mod.rs')
-rw-r--r--src/libstd/path/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs
index 63c81695aff..16552daae36 100644
--- a/src/libstd/path/mod.rs
+++ b/src/libstd/path/mod.rs
@@ -357,7 +357,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
                 match name.rposition_elem(&dot) {
                     None | Some(0) => name,
                     Some(1) if name == b".." => name,
-                    Some(pos) => name[..pos]
+                    Some(pos) => name.slice_to(pos)
                 }
             })
         }
@@ -404,7 +404,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
                 match name.rposition_elem(&dot) {
                     None | Some(0) => None,
                     Some(1) if name == b".." => None,
-                    Some(pos) => Some(name[pos+1..])
+                    Some(pos) => Some(name.slice_from(pos+1))
                 }
             }
         }
@@ -480,7 +480,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
             let extlen = extension.container_as_bytes().len();
             match (name.rposition_elem(&dot), extlen) {
                 (None, 0) | (Some(0), 0) => None,
-                (Some(idx), 0) => Some(name[..idx].to_vec()),
+                (Some(idx), 0) => Some(name.slice_to(idx).to_vec()),
                 (idx, extlen) => {
                     let idx = match idx {
                         None | Some(0) => name.len(),
@@ -489,7 +489,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
 
                     let mut v;
                     v = Vec::with_capacity(idx + extlen + 1);
-                    v.push_all(name[..idx]);
+                    v.push_all(name.slice_to(idx));
                     v.push(dot);
                     v.push_all(extension.container_as_bytes());
                     Some(v)