about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-10-31 00:03:52 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-11-01 19:56:07 -0500
commitfe256f81401e7af5fb3a3ec069427fd9c52073a9 (patch)
tree6ef164aedf102990948461ab89105984d53043d5
parent423e17b9df16990411cd7afded2e09139c6c6d09 (diff)
downloadrust-fe256f81401e7af5fb3a3ec069427fd9c52073a9.tar.gz
rust-fe256f81401e7af5fb3a3ec069427fd9c52073a9.zip
Remove unnecessary allocations
-rw-r--r--src/compiletest/runtest.rs2
-rw-r--r--src/librustc/driver/session.rs2
-rw-r--r--src/libstd/io/process.rs2
-rw-r--r--src/libterm/terminfo/searcher.rs2
-rw-r--r--src/test/run-pass/process-spawn-with-unicode-params.rs2
5 files changed, 5 insertions, 5 deletions
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index 283ca46a49f..55247792921 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -627,7 +627,7 @@ fn find_rust_src_root(config: &Config) -> Option<Path> {
     let path_postfix = Path::new("src/etc/lldb_batchmode.py");
 
     while path.pop() {
-        if path.join(path_postfix.clone()).is_file() {
+        if path.join(&path_postfix).is_file() {
             return Some(path);
         }
     }
diff --git a/src/librustc/driver/session.rs b/src/librustc/driver/session.rs
index 55e07321c71..f8e778ce15f 100644
--- a/src/librustc/driver/session.rs
+++ b/src/librustc/driver/session.rs
@@ -231,7 +231,7 @@ pub fn build_session_(sopts: config::Options,
         if path.is_absolute() {
             path.clone()
         } else {
-            os::getcwd().join(path.clone())
+            os::getcwd().join(&path)
         }
     );
 
diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs
index 4e5f8822acb..312a4c41ac9 100644
--- a/src/libstd/io/process.rs
+++ b/src/libstd/io/process.rs
@@ -918,7 +918,7 @@ mod tests {
         let prog = pwd_cmd().cwd(&parent_dir).spawn().unwrap();
 
         let output = String::from_utf8(prog.wait_with_output().unwrap().output).unwrap();
-        let child_dir = Path::new(output.as_slice().trim().into_string());
+        let child_dir = Path::new(output.as_slice().trim());
 
         let parent_stat = parent_dir.stat().unwrap();
         let child_stat = child_dir.stat().unwrap();
diff --git a/src/libterm/terminfo/searcher.rs b/src/libterm/terminfo/searcher.rs
index a89afab505b..61ff88a2fa3 100644
--- a/src/libterm/terminfo/searcher.rs
+++ b/src/libterm/terminfo/searcher.rs
@@ -41,7 +41,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<Path>> {
                     if i == "" {
                         dirs_to_search.push(Path::new("/usr/share/terminfo"));
                     } else {
-                        dirs_to_search.push(Path::new(i.to_string()));
+                        dirs_to_search.push(Path::new(i));
                     }
                 },
                 // Found nothing in TERMINFO_DIRS, use the default paths:
diff --git a/src/test/run-pass/process-spawn-with-unicode-params.rs b/src/test/run-pass/process-spawn-with-unicode-params.rs
index 9716d79f4c8..490614ef121 100644
--- a/src/test/run-pass/process-spawn-with-unicode-params.rs
+++ b/src/test/run-pass/process-spawn-with-unicode-params.rs
@@ -48,7 +48,7 @@ fn main() {
 
         let child_filestem = Path::new(child_name);
         let child_filename = child_filestem.with_extension(my_ext);
-        let child_path     = cwd.join(child_filename.clone());
+        let child_path     = cwd.join(child_filename);
 
         // make a separate directory for the child
         drop(fs::mkdir(&cwd, io::USER_RWX).is_ok());