Enable clippy::manual_find
(#8737)
This PR enables the [`clippy::manual_find`](https://rust-lang.github.io/rust-clippy/master/index.html#/manual_find) rule and fixes the outstanding violations. Release Notes: - N/A
This commit is contained in:
parent
fc8e515fe8
commit
a17c207217
2 changed files with 4 additions and 8 deletions
|
@ -245,7 +245,7 @@ impl Prettier {
|
|||
);
|
||||
let plugin_name_into_path = |plugin_name: &str| {
|
||||
let prettier_plugin_dir = prettier_node_modules.join(plugin_name);
|
||||
for possible_plugin_path in [
|
||||
[
|
||||
prettier_plugin_dir.join("dist").join("index.mjs"),
|
||||
prettier_plugin_dir.join("dist").join("index.js"),
|
||||
prettier_plugin_dir.join("dist").join("plugin.js"),
|
||||
|
@ -255,12 +255,9 @@ impl Prettier {
|
|||
// this one is for @prettier/plugin-php
|
||||
prettier_plugin_dir.join("standalone.js"),
|
||||
prettier_plugin_dir,
|
||||
] {
|
||||
if possible_plugin_path.is_file() {
|
||||
return Some(possible_plugin_path);
|
||||
}
|
||||
}
|
||||
None
|
||||
]
|
||||
.into_iter()
|
||||
.find(|possible_plugin_path| possible_plugin_path.is_file())
|
||||
};
|
||||
let (parser, located_plugins) = match parser_with_plugins {
|
||||
Some((parser, plugins)) => {
|
||||
|
|
|
@ -101,7 +101,6 @@ fn run_clippy(args: ClippyArgs) -> Result<()> {
|
|||
"clippy::iter_kv_map",
|
||||
"clippy::iter_overeager_cloned",
|
||||
"clippy::let_underscore_future",
|
||||
"clippy::manual_find",
|
||||
"clippy::manual_flatten",
|
||||
"clippy::map_entry",
|
||||
"clippy::needless_arbitrary_self_type",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue