Skip to content

Commit

Permalink
Remove unnecessary allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Aparicio committed Oct 31, 2014
1 parent 1cb8d1d commit cac515c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/driver/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
);

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/io/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/libterm/terminfo/searcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/process-spawn-with-unicode-params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

4 comments on commit cac515c

@bors
Copy link
Contributor

@bors bors commented on cac515c Nov 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at japaric@cac515c

@bors
Copy link
Contributor

@bors bors commented on cac515c Nov 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging japaric/rust/bytes2 = cac515c into auto

@bors
Copy link
Contributor

@bors bors commented on cac515c Nov 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

japaric/rust/bytes2 = cac515c merged ok, testing candidate = 0f53287a

@bors
Copy link
Contributor

@bors bors commented on cac515c Nov 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.