@@ -238,7 +238,7 @@ pub fn do_file_search(searchstr: &str, currentdir: &Path) -> vec::MoveItems<Matc
238
238
let fname = fpath. str_components ( ) . rev ( ) . next ( ) . unwrap ( ) . unwrap ( ) ;
239
239
if fname. starts_with ( format ! ( "lib{}" , searchstr) . as_slice ( ) ) {
240
240
//debug!("Yeah found {}",fpath.as_str());
241
- let filepath = Path :: new ( fpath) . join_many ( [ Path :: new ( "lib.rs" ) ] ) ;
241
+ let filepath = Path :: new ( fpath) . join_many ( & [ Path :: new ( "lib.rs" ) ] ) ;
242
242
if File :: open ( & filepath) . is_ok ( ) {
243
243
let m = Match { matchstr : fname. slice_from ( 3 ) . to_string ( ) ,
244
244
filepath : filepath. clone ( ) ,
@@ -256,7 +256,7 @@ pub fn do_file_search(searchstr: &str, currentdir: &Path) -> vec::MoveItems<Matc
256
256
if fname. starts_with ( searchstr) {
257
257
{
258
258
// try <name>/<name>.rs, like in the servo codebase
259
- let filepath = Path :: new ( fpath) . join_many ( [ Path :: new ( format ! ( "{}.rs" , fname) ) ] ) ;
259
+ let filepath = Path :: new ( fpath) . join_many ( & [ Path :: new ( format ! ( "{}.rs" , fname) ) ] ) ;
260
260
261
261
if File :: open ( & filepath) . is_ok ( ) {
262
262
let m = Match { matchstr : fname. to_string ( ) ,
@@ -273,7 +273,7 @@ pub fn do_file_search(searchstr: &str, currentdir: &Path) -> vec::MoveItems<Matc
273
273
}
274
274
{
275
275
// try <name>/mod.rs
276
- let filepath = Path :: new ( fpath) . join_many ( [ Path :: new ( "mod.rs" ) ] ) ;
276
+ let filepath = Path :: new ( fpath) . join_many ( & [ Path :: new ( "mod.rs" ) ] ) ;
277
277
if File :: open ( & filepath) . is_ok ( ) {
278
278
let m = Match { matchstr : fname. to_string ( ) ,
279
279
filepath : filepath. clone ( ) ,
@@ -289,7 +289,7 @@ pub fn do_file_search(searchstr: &str, currentdir: &Path) -> vec::MoveItems<Matc
289
289
}
290
290
{
291
291
// try <name>/lib.rs
292
- let filepath = Path :: new ( srcpath) . join_many ( [ Path :: new ( "lib.rs" ) ] ) ;
292
+ let filepath = Path :: new ( srcpath) . join_many ( & [ Path :: new ( "lib.rs" ) ] ) ;
293
293
if File :: open ( & filepath) . is_ok ( ) {
294
294
let m = Match { matchstr : fname. to_string ( ) ,
295
295
filepath : filepath. clone ( ) ,
@@ -356,14 +356,14 @@ pub fn find_possible_crate_root_modules(currentdir: &Path) -> Vec<Path> {
356
356
let mut res = Vec :: new ( ) ;
357
357
358
358
{
359
- let filepath = currentdir. join_many ( [ Path :: new ( "lib.rs" ) ] ) ;
359
+ let filepath = currentdir. join_many ( & [ Path :: new ( "lib.rs" ) ] ) ;
360
360
if File :: open ( & filepath) . is_ok ( ) {
361
361
res. push ( filepath) ;
362
362
return res; // for now stop at the first match
363
363
}
364
364
}
365
365
{
366
- let filepath = currentdir. join_many ( [ Path :: new ( "main.rs" ) ] ) ;
366
+ let filepath = currentdir. join_many ( & [ Path :: new ( "main.rs" ) ] ) ;
367
367
if File :: open ( & filepath) . is_ok ( ) {
368
368
res. push ( filepath) ;
369
369
return res; // for now stop at the first match
@@ -407,7 +407,7 @@ pub fn get_crate_file(name: &str) -> Option<Path> {
407
407
{
408
408
// try lib<name>/lib.rs, like in the rust source dir
409
409
let cratelibname = format ! ( "lib{}" , name) ;
410
- let filepath = Path :: new ( srcpath) . join_many ( [ Path :: new ( cratelibname) ,
410
+ let filepath = Path :: new ( srcpath) . join_many ( & [ Path :: new ( cratelibname) ,
411
411
Path :: new ( "lib.rs" ) ] ) ;
412
412
if File :: open ( & filepath) . is_ok ( ) {
413
413
return Some ( filepath) ;
@@ -416,7 +416,7 @@ pub fn get_crate_file(name: &str) -> Option<Path> {
416
416
417
417
{
418
418
// try <name>/lib.rs
419
- let filepath = Path :: new ( srcpath) . join_many ( [ Path :: new ( name) ,
419
+ let filepath = Path :: new ( srcpath) . join_many ( & [ Path :: new ( name) ,
420
420
Path :: new ( "lib.rs" ) ] ) ;
421
421
if File :: open ( & filepath) . is_ok ( ) {
422
422
return Some ( filepath) ;
@@ -429,14 +429,14 @@ pub fn get_crate_file(name: &str) -> Option<Path> {
429
429
pub fn get_module_file ( name : & str , parentdir : & Path ) -> Option < Path > {
430
430
{
431
431
// try just <name>.rs
432
- let filepath = parentdir. join_many ( [ Path :: new ( format ! ( "{}.rs" , name) ) ] ) ;
432
+ let filepath = parentdir. join_many ( & [ Path :: new ( format ! ( "{}.rs" , name) ) ] ) ;
433
433
if File :: open ( & filepath) . is_ok ( ) {
434
434
return Some ( filepath) ;
435
435
}
436
436
}
437
437
{
438
438
// try <name>/mod.rs
439
- let filepath = parentdir. join_many ( [ Path :: new ( name) ,
439
+ let filepath = parentdir. join_many ( & [ Path :: new ( name) ,
440
440
Path :: new ( "mod.rs" ) ] ) ;
441
441
if File :: open ( & filepath) . is_ok ( ) {
442
442
return Some ( filepath) ;
@@ -575,7 +575,7 @@ pub fn search_prelude_file(pathseg: &racer::PathSegment, search_type: SearchType
575
575
let v: Vec < & str > = srcpaths. as_slice ( ) . split_str ( ":" ) . collect ( ) ;
576
576
577
577
for srcpath in v. into_iter ( ) {
578
- let filepath = Path :: new ( srcpath) . join_many ( [ Path :: new ( "libstd" ) ,
578
+ let filepath = Path :: new ( srcpath) . join_many ( & [ Path :: new ( "libstd" ) ,
579
579
Path :: new ( "prelude.rs" ) ] ) ;
580
580
if File :: open ( & filepath) . is_ok ( ) {
581
581
let msrc = racer:: load_file_and_mask_comments ( & filepath) ;
0 commit comments