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 <aramisnoah@gmail.com>
This commit is contained in:
bors[bot] 2021-11-03 07:40:23 +00:00 committed by GitHub
commit 71f5dae4b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,8 +50,8 @@ fn fix_path_for_mac() -> Result<()> {
};
[ROOT_DIR, &home_dir]
.iter()
.map(|dir| String::from(*dir) + COMMON_APP_PATH)
.into_iter()
.map(|dir| dir.to_string() + COMMON_APP_PATH)
.map(PathBuf::from)
.filter(|path| path.exists())
.collect()