about summary refs log tree commit diff
path: root/src/libstd/path.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-06-12 18:10:49 -0700
committerbors <bors@rust-lang.org>2013-06-12 18:10:49 -0700
commitda510bfb4a3f6ca805e849372f9bbe7b2b0f6a61 (patch)
treecb272a50c99d8001304f044fd8a1128d30654b61 /src/libstd/path.rs
parent84bed9769b5d15871481b657860ad6a7d0a62f42 (diff)
parent5ebffd46d5f7476c8124856c37538088da0c918e (diff)
downloadrust-da510bfb4a3f6ca805e849372f9bbe7b2b0f6a61.tar.gz
rust-da510bfb4a3f6ca805e849372f9bbe7b2b0f6a61.zip
auto merge of #7086 : huonw/rust/5048, r=graydon
Fixes #5048.

I'm sure this reduces memory usage, but I can't get cgroups to work properly to actually measure memory. (It doesn't appear to offer much speed improvement, but I'm fairly sure it's not slower.)

This is quite huge, so it'd be nice to get a resolution soon.
Diffstat (limited to 'src/libstd/path.rs')
-rw-r--r--src/libstd/path.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 02772604e45..9c4e8f08358 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -22,7 +22,7 @@ use iterator::IteratorUtil;
 use libc;
 use option::{None, Option, Some};
 use str;
-use str::{StrSlice, StrVector};
+use str::{Str, StrSlice, StrVector};
 use to_str::ToStr;
 use ascii::{AsciiCast, AsciiStr};
 use old_iter::BaseIter;
@@ -102,7 +102,7 @@ pub trait GenericPath {
     fn push_rel(&self, (&Self)) -> Self;
     /// Returns a new Path consisting of the path given by the given vector
     /// of strings, relative to `self`.
-    fn push_many(&self, (&[~str])) -> Self;
+    fn push_many<S: Str>(&self, (&[S])) -> Self;
     /// Identical to `dir_path` except in the case where `self` has only one
     /// component. In this case, `pop` returns the empty path.
     fn pop(&self) -> Self;
@@ -566,10 +566,10 @@ impl GenericPath for PosixPath {
         false
     }
 
-    fn push_many(&self, cs: &[~str]) -> PosixPath {
+    fn push_many<S: Str>(&self, cs: &[S]) -> PosixPath {
         let mut v = copy self.components;
         for cs.each |e| {
-            for e.split_iter(windows::is_sep).advance |s| {
+            for e.as_slice().split_iter(windows::is_sep).advance |s| {
                 if !s.is_empty() {
                     v.push(s.to_owned())
                 }
@@ -823,10 +823,10 @@ impl GenericPath for WindowsPath {
         }
     }
 
-    fn push_many(&self, cs: &[~str]) -> WindowsPath {
+    fn push_many<S: Str>(&self, cs: &[S]) -> WindowsPath {
         let mut v = copy self.components;
         for cs.each |e| {
-            for e.split_iter(windows::is_sep).advance |s| {
+            for e.as_slice().split_iter(windows::is_sep).advance |s| {
                 if !s.is_empty() {
                     v.push(s.to_owned())
                 }