Rollup merge of #118889 - matthiaskrgr:compl_2023_2, r=WaffleLapkin
more clippy::complexity fixes
redundant_guards
redundant_slicing
filter_next
needless_borrowed_reference
useless_format
This commit is contained in:
commit
4583a0134f
10 changed files with 18 additions and 28 deletions
|
|
@ -2245,8 +2245,8 @@ impl GenericArgs {
|
|||
}
|
||||
pub(crate) fn bindings<'a>(&'a self) -> Box<dyn Iterator<Item = TypeBinding> + 'a> {
|
||||
match self {
|
||||
&GenericArgs::AngleBracketed { ref bindings, .. } => Box::new(bindings.iter().cloned()),
|
||||
&GenericArgs::Parenthesized { ref output, .. } => Box::new(
|
||||
GenericArgs::AngleBracketed { bindings, .. } => Box::new(bindings.iter().cloned()),
|
||||
GenericArgs::Parenthesized { output, .. } => Box::new(
|
||||
output
|
||||
.as_ref()
|
||||
.map(|ty| TypeBinding {
|
||||
|
|
@ -2270,8 +2270,8 @@ impl<'a> IntoIterator for &'a GenericArgs {
|
|||
type Item = GenericArg;
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
match self {
|
||||
&GenericArgs::AngleBracketed { ref args, .. } => Box::new(args.iter().cloned()),
|
||||
&GenericArgs::Parenthesized { ref inputs, .. } => {
|
||||
GenericArgs::AngleBracketed { args, .. } => Box::new(args.iter().cloned()),
|
||||
GenericArgs::Parenthesized { inputs, .. } => {
|
||||
Box::new(inputs.iter().cloned().map(GenericArg::Type))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue