about summary refs log tree commit diff
path: root/src/libextra/fileinput.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libextra/fileinput.rs')
-rw-r--r--src/libextra/fileinput.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libextra/fileinput.rs b/src/libextra/fileinput.rs
index 08d1222ff46..8f176d5ccea 100644
--- a/src/libextra/fileinput.rs
+++ b/src/libextra/fileinput.rs
@@ -358,11 +358,11 @@ instance. `stdin_hyphen` controls whether `-` represents `stdin` or
 a literal `-`.
 */
 pub fn make_path_option_vec(vec: &[~str], stdin_hyphen : bool) -> ~[Option<Path>] {
-    vec.iter().map(|str| {
-        if stdin_hyphen && "-" == *str {
+    vec.iter().map(|s| {
+        if stdin_hyphen && "-" == *s {
             None
         } else {
-            Some(Path::from_str(*str))
+            Some(Path::new(s.as_slice()))
         }
     }).collect()
 }
@@ -435,14 +435,14 @@ mod test {
     fn test_make_path_option_vec() {
         let strs = [~"some/path",
                     ~"some/other/path"];
-        let paths = ~[Some(Path::from_str("some/path")),
-                      Some(Path::from_str("some/other/path"))];
+        let paths = ~[Some(Path::new("some/path")),
+                      Some(Path::new("some/other/path"))];
 
         assert_eq!(make_path_option_vec(strs, true), paths.clone());
         assert_eq!(make_path_option_vec(strs, false), paths);
 
         assert_eq!(make_path_option_vec([~"-"], true), ~[None]);
-        assert_eq!(make_path_option_vec([~"-"], false), ~[Some(Path::from_str("-"))]);
+        assert_eq!(make_path_option_vec([~"-"], false), ~[Some(Path::new("-"))]);
     }
 
     #[test]
@@ -567,9 +567,9 @@ mod test {
     #[test]
     fn test_no_trailing_newline() {
         let f1 =
-            Some(Path::from_str("tmp/lib-fileinput-test-no-trailing-newline-1.tmp"));
+            Some(Path::new("tmp/lib-fileinput-test-no-trailing-newline-1.tmp"));
         let f2 =
-            Some(Path::from_str("tmp/lib-fileinput-test-no-trailing-newline-2.tmp"));
+            Some(Path::new("tmp/lib-fileinput-test-no-trailing-newline-2.tmp"));
 
         {
             let mut wr = file::open(f1.get_ref(), io::CreateOrTruncate,