about summary refs log tree commit diff
path: root/src/libstd/path/mod.rs
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2014-09-24 23:41:09 +1200
committerNick Cameron <ncameron@mozilla.com>2014-10-07 15:49:53 +1300
commit59976942eacd26c0cc37247c3ac0c78b97edc6ea (patch)
tree81df79265eb8601f2965303b9626b80ee728208f /src/libstd/path/mod.rs
parentb5ba2f5517b1f90d07969ca3facdf5132e42436c (diff)
downloadrust-59976942eacd26c0cc37247c3ac0c78b97edc6ea.tar.gz
rust-59976942eacd26c0cc37247c3ac0c78b97edc6ea.zip
Use slice syntax instead of slice_to, etc.
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 16552daae36..63c81695aff 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.slice_to(pos)
+                    Some(pos) => name[..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.slice_from(pos+1))
+                    Some(pos) => Some(name[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.slice_to(idx).to_vec()),
+                (Some(idx), 0) => Some(name[..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.slice_to(idx));
+                    v.push_all(name[..idx]);
                     v.push(dot);
                     v.push_all(extension.container_as_bytes());
                     Some(v)