]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/parse/parser.rs
libstd: Remove all uses of `~str` from `libstd`
[rust.git] / src / libsyntax / parse / parser.rs
index 6bddb45201c110ffee6d716ecfe995ca78446ab9..7d0276ae16f7b2d009915b9fd71e7f9eea19819a 100644 (file)
@@ -4242,8 +4242,8 @@ fn eval_src_mod(&mut self,
             Some(d) => (dir_path.join(d), true),
             None => {
                 let mod_name = mod_string.get().to_owned();
-                let default_path_str = mod_name + ".rs";
-                let secondary_path_str = mod_name + "/mod.rs";
+                let default_path_str = format!("{}.rs", mod_name);
+                let secondary_path_str = format!("{}/mod.rs", mod_name);
                 let default_path = dir_path.join(default_path_str.as_slice());
                 let secondary_path = dir_path.join(secondary_path_str.as_slice());
                 let default_exists = default_path.exists();
@@ -4310,7 +4310,7 @@ fn eval_src_mod_from_path(&mut self,
                     err.push_str(" -> ");
                 }
                 err.push_str(path.display().as_maybe_owned().as_slice());
-                self.span_fatal(id_sp, err.into_owned());
+                self.span_fatal(id_sp, err.as_slice());
             }
             None => ()
         }