Rollup merge of #101391 - matthiaskrgr:perf0309, r=oli-obk
more clippy::perf fixes
This commit is contained in:
commit
e4534fe6fe
6 changed files with 11 additions and 19 deletions
|
|
@ -2367,9 +2367,9 @@ pub(crate) fn get_filtered_impls_for_reference<'a>(
|
|||
let Some(v) = shared.cache.impls.get(&def_id) else { return (Vec::new(), Vec::new(), Vec::new()) };
|
||||
// Since there is no "direct implementation" on the reference primitive type, we filter out
|
||||
// every implementation which isn't a trait implementation.
|
||||
let traits: Vec<_> = v.iter().filter(|i| i.inner_impl().trait_.is_some()).collect();
|
||||
let traits = v.iter().filter(|i| i.inner_impl().trait_.is_some());
|
||||
let (synthetic, concrete): (Vec<&Impl>, Vec<&Impl>) =
|
||||
traits.into_iter().partition(|t| t.inner_impl().kind.is_auto());
|
||||
traits.partition(|t| t.inner_impl().kind.is_auto());
|
||||
|
||||
let (blanket_impl, concrete): (Vec<&Impl>, _) =
|
||||
concrete.into_iter().partition(|t| t.inner_impl().kind.is_blanket());
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ pub(super) fn write_shared(
|
|||
if line.starts_with(&prefix) {
|
||||
continue;
|
||||
}
|
||||
if line.ends_with(",") {
|
||||
if line.ends_with(',') {
|
||||
ret.push(line[..line.len() - 1].to_string());
|
||||
} else {
|
||||
// No comma (it's the case for the last added crate line)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue