more clippy fixes: clippy::{iter_cloned_collect, unwarp_or_else_default, option_map_or_none}
This commit is contained in:
parent
e6e956dade
commit
6ef8648a48
@ -1317,7 +1317,7 @@ fn compare_number_of_generics<'tcx>(
|
||||
impl_count,
|
||||
kind,
|
||||
pluralize!(impl_count),
|
||||
suffix.unwrap_or_else(String::new),
|
||||
suffix.unwrap_or_default(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -292,10 +292,8 @@ impl DebugCounters {
|
||||
}
|
||||
|
||||
pub fn some_block_label(&self, operand: ExpressionOperandId) -> Option<&String> {
|
||||
self.some_counters.as_ref().map_or(None, |counters| {
|
||||
counters
|
||||
.get(&operand)
|
||||
.map_or(None, |debug_counter| debug_counter.some_block_label.as_ref())
|
||||
self.some_counters.as_ref().and_then(|counters| {
|
||||
counters.get(&operand).and_then(|debug_counter| debug_counter.some_block_label.as_ref())
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ pub(crate) mod rustc {
|
||||
fn from(err: LayoutError<'tcx>) -> Self {
|
||||
match err {
|
||||
LayoutError::Unknown(..) => Self::Unknown,
|
||||
err @ _ => unimplemented!("{:?}", err),
|
||||
err => unimplemented!("{:?}", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ where
|
||||
let f = auto_trait::AutoTraitFinder::new(tcx);
|
||||
|
||||
debug!("get_auto_trait_impls({:?})", ty);
|
||||
let auto_traits: Vec<_> = self.cx.auto_traits.iter().copied().collect();
|
||||
let auto_traits: Vec<_> = self.cx.auto_traits.to_vec();
|
||||
let mut auto_traits: Vec<Item> = auto_traits
|
||||
.into_iter()
|
||||
.filter_map(|trait_def_id| {
|
||||
|
Loading…
x
Reference in New Issue
Block a user