diff --git a/src/racer/nameres.rs b/src/racer/nameres.rs index a72a02b3..6ba7a908 100644 --- a/src/racer/nameres.rs +++ b/src/racer/nameres.rs @@ -238,7 +238,7 @@ pub fn do_file_search(searchstr: &str, currentdir: &Path) -> vec::MoveItems vec::MoveItems/.rs, like in the servo codebase - let filepath = Path::new(fpath).join_many([Path::new(format!("{}.rs", fname))]); + let filepath = Path::new(fpath).join_many(&[Path::new(format!("{}.rs", fname))]); if File::open(&filepath).is_ok() { let m = Match {matchstr: fname.to_string(), @@ -273,7 +273,7 @@ pub fn do_file_search(searchstr: &str, currentdir: &Path) -> vec::MoveItems/mod.rs - let filepath = Path::new(fpath).join_many([Path::new("mod.rs")]); + let filepath = Path::new(fpath).join_many(&[Path::new("mod.rs")]); if File::open(&filepath).is_ok() { let m = Match {matchstr: fname.to_string(), filepath: filepath.clone(), @@ -289,7 +289,7 @@ pub fn do_file_search(searchstr: &str, currentdir: &Path) -> vec::MoveItems/lib.rs - let filepath = Path::new(srcpath).join_many([Path::new("lib.rs")]); + let filepath = Path::new(srcpath).join_many(&[Path::new("lib.rs")]); if File::open(&filepath).is_ok() { let m = Match {matchstr: fname.to_string(), filepath: filepath.clone(), @@ -356,14 +356,14 @@ pub fn find_possible_crate_root_modules(currentdir: &Path) -> Vec { let mut res = Vec::new(); { - let filepath = currentdir.join_many([Path::new("lib.rs")]); + let filepath = currentdir.join_many(&[Path::new("lib.rs")]); if File::open(&filepath).is_ok() { res.push(filepath); return res; // for now stop at the first match } } { - let filepath = currentdir.join_many([Path::new("main.rs")]); + let filepath = currentdir.join_many(&[Path::new("main.rs")]); if File::open(&filepath).is_ok() { res.push(filepath); return res; // for now stop at the first match @@ -407,7 +407,7 @@ pub fn get_crate_file(name: &str) -> Option { { // try lib/lib.rs, like in the rust source dir let cratelibname = format!("lib{}", name); - let filepath = Path::new(srcpath).join_many([Path::new(cratelibname), + let filepath = Path::new(srcpath).join_many(&[Path::new(cratelibname), Path::new("lib.rs")]); if File::open(&filepath).is_ok() { return Some(filepath); @@ -416,7 +416,7 @@ pub fn get_crate_file(name: &str) -> Option { { // try /lib.rs - let filepath = Path::new(srcpath).join_many([Path::new(name), + let filepath = Path::new(srcpath).join_many(&[Path::new(name), Path::new("lib.rs")]); if File::open(&filepath).is_ok() { return Some(filepath); @@ -429,14 +429,14 @@ pub fn get_crate_file(name: &str) -> Option { pub fn get_module_file(name: &str, parentdir: &Path) -> Option { { // try just .rs - let filepath = parentdir.join_many([Path::new(format!("{}.rs", name))]); + let filepath = parentdir.join_many(&[Path::new(format!("{}.rs", name))]); if File::open(&filepath).is_ok() { return Some(filepath); } } { // try /mod.rs - let filepath = parentdir.join_many([Path::new(name), + let filepath = parentdir.join_many(&[Path::new(name), Path::new("mod.rs")]); if File::open(&filepath).is_ok() { return Some(filepath); @@ -575,7 +575,7 @@ pub fn search_prelude_file(pathseg: &racer::PathSegment, search_type: SearchType let v: Vec<&str> = srcpaths.as_slice().split_str(":").collect(); for srcpath in v.into_iter() { - let filepath = Path::new(srcpath).join_many([Path::new("libstd"), + let filepath = Path::new(srcpath).join_many(&[Path::new("libstd"), Path::new("prelude.rs")]); if File::open(&filepath).is_ok() { let msrc = racer::load_file_and_mask_comments(&filepath);