Rollup merge of #69802 - matthiaskrgr:cl1ppy, r=Dylan-DPC
fix more clippy findings * reduce references on match patterns (clippy::match_ref_pats) * Use writeln!(fmt, "word") instead of write!(fmt, "word\n") (clippy::write_with_newline) * libtest: remove redundant argument to writeln!() (clippy::writeln_empty_string) * remove unneeded mutable references (cippy::unnecessary_mut_passed) * libtest: declare variables as floats instead of casting them (clippy::unnecessary_cast) * rustdoc: remove redundant static lifetimes (clippy::redundant_static_lifetimes) * call .as_deref() instead of .as_ref().map(Deref::deref) (clippy::option_as_ref_deref) * iterate over a maps values directly. (clippy::for_kv_map) * rustdoc: simplify boolean condition (clippy::nonminimal_bool) * Use ?-operator in more places (clippy::question_mark, had some false negatives fixed recently) * rustdoc: Use .any(p) instead of find(p).is_some(). (clippy::search_is_some) * rustdoc: don't call into_iter() on iterator. (clippy::identity_conversion)
This commit is contained in:
commit
8e17c8366c
23 changed files with 78 additions and 118 deletions
|
@ -1543,7 +1543,7 @@ impl Context {
|
|||
}
|
||||
|
||||
if self.shared.sort_modules_alphabetically {
|
||||
for (_, items) in &mut map {
|
||||
for items in map.values_mut() {
|
||||
items.sort();
|
||||
}
|
||||
}
|
||||
|
@ -3396,10 +3396,8 @@ fn render_assoc_items(
|
|||
let deref_impl =
|
||||
traits.iter().find(|t| t.inner_impl().trait_.def_id() == c.deref_trait_did);
|
||||
if let Some(impl_) = deref_impl {
|
||||
let has_deref_mut = traits
|
||||
.iter()
|
||||
.find(|t| t.inner_impl().trait_.def_id() == c.deref_mut_trait_did)
|
||||
.is_some();
|
||||
let has_deref_mut =
|
||||
traits.iter().any(|t| t.inner_impl().trait_.def_id() == c.deref_mut_trait_did);
|
||||
render_deref_methods(w, cx, impl_, containing_item, has_deref_mut);
|
||||
}
|
||||
|
||||
|
@ -3740,7 +3738,7 @@ fn render_impl(
|
|||
) {
|
||||
for trait_item in &t.items {
|
||||
let n = trait_item.name.clone();
|
||||
if i.items.iter().find(|m| m.name == n).is_some() {
|
||||
if i.items.iter().any(|m| m.name == n) {
|
||||
continue;
|
||||
}
|
||||
let did = i.trait_.as_ref().unwrap().def_id().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue