Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some clippy lints for library/std/src/sys/windows #118154

Merged
merged 17 commits into from
Nov 23, 2023
Prev Previous commit
Next Next commit
needless_borrows_for_generic_args
the borrowed expression implements the required traits
  • Loading branch information
ChrisDenton committed Nov 22, 2023
commit 42734599bd613efee41d0a508e0fc60ea6d86058
2 changes: 1 addition & 1 deletion library/std/src/sys/windows/fs.rs
Original file line number Diff line number Diff line change
@@ -156,7 +156,7 @@ impl DirEntry {
}

pub fn path(&self) -> PathBuf {
self.root.join(&self.file_name())
self.root.join(self.file_name())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we uplift this clippy lint? 🙂

(Not in this PR, obviously)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's needless_borrows_for_generic_args. There's also the related needless_borrow which found a lot too!

}

pub fn file_name(&self) -> OsString {
2 changes: 1 addition & 1 deletion library/std/src/sys/windows/process.rs
Original file line number Diff line number Diff line change
@@ -463,7 +463,7 @@ fn resolve_exe<'a>(

// Search the directories given by `search_paths`.
let result = search_paths(parent_paths, child_paths, |mut path| {
path.push(&exe_path);
path.push(exe_path);
if !has_extension {
path.set_extension(EXE_EXTENSION);
}