Skip to content

Commit 71f5dae

Browse files
Merge #10683
10683: minor: Use `.into_iter()` method on array to avoid dereference r=lnicola a=arzg Arguably it’s nicer to just use `.into_iter()` instead of iterating over references which are immediately dereferenced. I also changed the use of `String::from` to `.to_string()` because the latter has around twenty times more usages in rust-analyzer. Co-authored-by: Aramis Razzaghipour <[email protected]>
2 parents 04f03a3 + 16d38ec commit 71f5dae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xtask/src/install.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ fn fix_path_for_mac() -> Result<()> {
5050
};
5151

5252
[ROOT_DIR, &home_dir]
53-
.iter()
54-
.map(|dir| String::from(*dir) + COMMON_APP_PATH)
53+
.into_iter()
54+
.map(|dir| dir.to_string() + COMMON_APP_PATH)
5555
.map(PathBuf::from)
5656
.filter(|path| path.exists())
5757
.collect()

0 commit comments

Comments
 (0)