Skip to content

Commit

Permalink
Remove what appears to be redundant indirection from
Browse files Browse the repository at this point in the history
os::list_dir_path.
  • Loading branch information
Dretch committed Jul 21, 2013
1 parent c4b6216 commit a626369
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
let mut tests = ~[];
let dirs = os::list_dir_path(&config.src_base);
for dirs.iter().advance |file| {
let file = (*file).clone();
let file = file.clone();
debug!("inspecting file %s", file.to_str());
if is_test(config, file) {
let t = do make_test(config, file) {
if is_test(config, &file) {
let t = do make_test(config, &file) {
match config.mode {
mode_codegen => make_metrics_test_closure(config, file),
_ => make_test_closure(config, file)
mode_codegen => make_metrics_test_closure(config, &file),
_ => make_test_closure(config, &file)
}
};
tests.push(t)
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/filesearch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub fn search<T>(filesearch: @FileSearch, pick: pick<T>) -> Option<T> {
let r = os::list_dir_path(lib_search_path);
for r.iter().advance |path| {
debug!("testing %s", path.to_str());
let maybe_picked = pick(*path);
let maybe_picked = pick(path);
if maybe_picked.is_some() {
debug!("picked %s", path.to_str());
rslt = maybe_picked;
Expand Down
4 changes: 2 additions & 2 deletions src/librustpkg/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,9 @@ fn frob_source_file(workspace: &Path, pkgid: &PkgId) {
}
match maybe_p {
Some(p) => {
let w = io::file_writer(*p, &[io::Append]);
let w = io::file_writer(p, &[io::Append]);
match w {
Err(s) => { let _ = cond.raise(((**p).clone(), fmt!("Bad path: %s", s))); }
Err(s) => { let _ = cond.raise((p.clone(), fmt!("Bad path: %s", s))); }
Ok(w) => w.write_line("")
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,8 @@ pub fn list_dir(p: &Path) -> ~[~str] {
*
* This version prepends each entry with the directory.
*/
pub fn list_dir_path(p: &Path) -> ~[~Path] {
list_dir(p).map(|f| ~p.push(*f))
pub fn list_dir_path(p: &Path) -> ~[Path] {
list_dir(p).map(|f| p.push(*f))
}

/// Removes a directory at the specified path, after removing
Expand Down

5 comments on commit a626369

@bors
Copy link
Contributor

@bors bors commented on a626369 Jul 22, 2013

Choose a reason for hiding this comment

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

saw approval from brson
at Dretch@a626369

@bors
Copy link
Contributor

@bors bors commented on a626369 Jul 22, 2013

Choose a reason for hiding this comment

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

merging Dretch/rust/os-listdir-path-no-squiggle = a626369 into auto

@bors
Copy link
Contributor

@bors bors commented on a626369 Jul 22, 2013

Choose a reason for hiding this comment

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

Dretch/rust/os-listdir-path-no-squiggle = a626369 merged ok, testing candidate = 2f7d86f

@bors
Copy link
Contributor

@bors bors commented on a626369 Jul 22, 2013

Choose a reason for hiding this comment

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

fast-forwarding master to auto = 2f7d86f

Please sign in to comment.