Remove what appears to be redundant indirection from
os::list_dir_path.
This commit is contained in:
parent
c4b6216943
commit
a6263694ff
src
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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("")
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user