about summary refs log tree commit diff
path: root/src/libstd/path/mod.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-07 17:26:58 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-07 17:26:58 -0800
commit6e806bdefde91af102567ef4b5dbd3ccf0c5c2ec (patch)
treeb8627ad2c80976f618b661ec14695f6a322ad1b3 /src/libstd/path/mod.rs
parentf6a7dc5528a9a9ac36867bbca2a6044b7be5bce2 (diff)
parent7d72719efc25c6cdb8963c187e93df646ba65245 (diff)
downloadrust-6e806bdefde91af102567ef4b5dbd3ccf0c5c2ec.tar.gz
rust-6e806bdefde91af102567ef4b5dbd3ccf0c5c2ec.zip
rollup merge of #20721: japaric/snap
Conflicts:
	src/libcollections/vec.rs
	src/libcore/fmt/mod.rs
	src/librustc/lint/builtin.rs
	src/librustc/session/config.rs
	src/librustc_trans/trans/base.rs
	src/librustc_trans/trans/context.rs
	src/librustc_trans/trans/type_.rs
	src/librustc_typeck/check/_match.rs
	src/librustdoc/html/format.rs
	src/libsyntax/std_inject.rs
	src/libsyntax/util/interner.rs
	src/test/compile-fail/mut-pattern-mismatched.rs
Diffstat (limited to 'src/libstd/path/mod.rs')
-rw-r--r--src/libstd/path/mod.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs
index aa59d60d7a4..b474ae4e371 100644
--- a/src/libstd/path/mod.rs
+++ b/src/libstd/path/mod.rs
@@ -68,7 +68,7 @@ use fmt;
 use iter::IteratorExt;
 use option::Option;
 use option::Option::{None, Some};
-use ops::{FullRange, Index};
+use ops::FullRange;
 use str;
 use str::StrExt;
 use string::{String, CowString};
@@ -352,7 +352,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
                 match name.rposition_elem(&dot) {
                     None | Some(0) => name,
                     Some(1) if name == b".." => name,
-                    Some(pos) => name.index(&(0..pos))
+                    Some(pos) => &name[0..pos]
                 }
             })
         }
@@ -399,7 +399,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.index(&((pos+1)..)))
+                    Some(pos) => Some(&name[(pos+1)..])
                 }
             }
         }
@@ -475,7 +475,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.index(&(0..idx)).to_vec()),
+                (Some(idx), 0) => Some(name[0..idx].to_vec()),
                 (idx, extlen) => {
                     let idx = match idx {
                         None | Some(0) => name.len(),
@@ -484,7 +484,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
 
                     let mut v;
                     v = Vec::with_capacity(idx + extlen + 1);
-                    v.push_all(name.index(&(0..idx)));
+                    v.push_all(&name[0..idx]);
                     v.push(dot);
                     v.push_all(extension.container_as_bytes());
                     Some(v)
@@ -876,7 +876,7 @@ impl BytesContainer for String {
     }
     #[inline]
     fn container_as_str(&self) -> Option<&str> {
-        Some(self.index(&FullRange))
+        Some(&self[])
     }
     #[inline]
     fn is_str(_: Option<&String>) -> bool { true }
@@ -892,7 +892,7 @@ impl BytesContainer for [u8] {
 impl BytesContainer for Vec<u8> {
     #[inline]
     fn container_as_bytes(&self) -> &[u8] {
-        self.index(&FullRange)
+        &self[]
     }
 }