about summary refs log tree commit diff
path: root/src/libstd/old_path/posix.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/old_path/posix.rs')
-rw-r--r--src/libstd/old_path/posix.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libstd/old_path/posix.rs b/src/libstd/old_path/posix.rs
index bbc1756bee6..f215e73202c 100644
--- a/src/libstd/old_path/posix.rs
+++ b/src/libstd/old_path/posix.rs
@@ -20,7 +20,7 @@ use iter::{Iterator, Map};
 use marker::Sized;
 use option::Option::{self, Some, None};
 use result::Result::{self, Ok, Err};
-use slice::{AsSlice, Split, SliceConcatExt};
+use slice::{Split, SliceConcatExt};
 use str::{self, FromStr};
 use vec::Vec;
 
@@ -339,11 +339,11 @@ impl Path {
 
     /// Returns a normalized byte vector representation of a path, by removing all empty
     /// components, and unnecessary . and .. components.
-    fn normalize<V: ?Sized + AsSlice<u8>>(v: &V) -> Vec<u8> {
+    fn normalize(v: &[u8]) -> Vec<u8> {
         // borrowck is being very picky
         let val = {
-            let is_abs = !v.as_slice().is_empty() && v.as_slice()[0] == SEP_BYTE;
-            let v_ = if is_abs { &v.as_slice()[1..] } else { v.as_slice() };
+            let is_abs = !v.is_empty() && v[0] == SEP_BYTE;
+            let v_ = if is_abs { &v[1..] } else { v };
             let comps = normalize_helper(v_, is_abs);
             match comps {
                 None => None,
@@ -371,7 +371,7 @@ impl Path {
             }
         };
         match val {
-            None => v.as_slice().to_vec(),
+            None => v.to_vec(),
             Some(val) => val
         }
     }
@@ -446,8 +446,7 @@ mod tests {
     use clone::Clone;
     use option::Option::{self, Some, None};
     use old_path::GenericPath;
-    use slice::AsSlice;
-    use str::{self, Str};
+    use str;
     use string::ToString;
     use vec::Vec;
     use iter::Iterator;