rustdoc: Use .any(p) instead of find(p).is_some(). (clippy::search_is_some)
This commit is contained in:
parent
9fa79813f9
commit
6bfff8a303
1 changed files with 3 additions and 5 deletions
|
@ -3401,10 +3401,8 @@ fn render_assoc_items(
|
||||||
let deref_impl =
|
let deref_impl =
|
||||||
traits.iter().find(|t| t.inner_impl().trait_.def_id() == c.deref_trait_did);
|
traits.iter().find(|t| t.inner_impl().trait_.def_id() == c.deref_trait_did);
|
||||||
if let Some(impl_) = deref_impl {
|
if let Some(impl_) = deref_impl {
|
||||||
let has_deref_mut = traits
|
let has_deref_mut =
|
||||||
.iter()
|
traits.iter().any(|t| t.inner_impl().trait_.def_id() == c.deref_mut_trait_did);
|
||||||
.find(|t| t.inner_impl().trait_.def_id() == c.deref_mut_trait_did)
|
|
||||||
.is_some();
|
|
||||||
render_deref_methods(w, cx, impl_, containing_item, has_deref_mut);
|
render_deref_methods(w, cx, impl_, containing_item, has_deref_mut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3816,7 +3814,7 @@ fn render_impl(
|
||||||
) {
|
) {
|
||||||
for trait_item in &t.items {
|
for trait_item in &t.items {
|
||||||
let n = trait_item.name.clone();
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
let did = i.trait_.as_ref().unwrap().def_id().unwrap();
|
let did = i.trait_.as_ref().unwrap().def_id().unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue