diff options
| author | bors <bors@rust-lang.org> | 2022-10-08 21:24:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-08 21:24:54 +0000 |
| commit | 272bbfb857650e0d3d05dd83a5ce1a522c94b4bd (patch) | |
| tree | ff6f3b941d23a479ff99eab4f44ae373cfa24d5c /clippy_dev/src | |
| parent | 292e313259f422c8f4c31ecaedcc14058e8f4f8b (diff) | |
| parent | 9cc8da222b3893bc13bc13c8827e93f8ea246854 (diff) | |
| download | rust-272bbfb857650e0d3d05dd83a5ce1a522c94b4bd.tar.gz rust-272bbfb857650e0d3d05dd83a5ce1a522c94b4bd.zip | |
Auto merge of #9386 - smoelius:further-enhance-needless-borrow, r=Jarcho
Further enhance `needless_borrow`, mildly refactor `redundant_clone` This PR does the following: * Moves some code from `redundant_clone` into a new `clippy_utils` module called `mir`, and wraps that code in a function called `dropped_without_further_use`. * Relaxes the "is copyable" condition condition from #9136 by also suggesting to remove borrows from values dropped without further use. The changes involve the just mentioned function. * Separates `redundant_clone` into modules. Strictly speaking, the last bullet is independent of the others. `redundant_clone` is somewhat hairy, IMO. Separating it into modules makes it slightly less so, by helping to delineate what depends upon what. I've tried to break everything up into digestible commits. r? `@Jarcho` (`@Jarcho` I hope you don't mind.) changelog: continuation of #9136
Diffstat (limited to 'clippy_dev/src')
| -rw-r--r-- | clippy_dev/src/serve.rs | 2 | ||||
| -rw-r--r-- | clippy_dev/src/update_lints.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clippy_dev/src/serve.rs b/clippy_dev/src/serve.rs index 2e0794f12fa..535c25e69f1 100644 --- a/clippy_dev/src/serve.rs +++ b/clippy_dev/src/serve.rs @@ -49,7 +49,7 @@ fn mtime(path: impl AsRef<Path>) -> SystemTime { .into_iter() .flatten() .flatten() - .map(|entry| mtime(&entry.path())) + .map(|entry| mtime(entry.path())) .max() .unwrap_or(SystemTime::UNIX_EPOCH) } else { diff --git a/clippy_dev/src/update_lints.rs b/clippy_dev/src/update_lints.rs index 0eb443167ec..8d1bfacd1dc 100644 --- a/clippy_dev/src/update_lints.rs +++ b/clippy_dev/src/update_lints.rs @@ -128,7 +128,7 @@ fn generate_lint_files( for (lint_group, lints) in Lint::by_lint_group(usable_lints.into_iter().chain(internal_lints)) { let content = gen_lint_group_list(&lint_group, lints.iter()); process_file( - &format!("clippy_lints/src/lib.register_{lint_group}.rs"), + format!("clippy_lints/src/lib.register_{lint_group}.rs"), update_mode, &content, ); |
