We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
map_unwrap_or
1 parent 6375703 commit 0b7431eCopy full SHA for 0b7431e
clippy_lints/src/derivable_impls.rs
@@ -105,7 +105,7 @@ fn check_struct<'tcx>(
105
if let TyKind::Path(QPath::Resolved(_, p)) = self_ty.kind
106
&& let Some(PathSegment { args, .. }) = p.segments.last()
107
{
108
- let args = args.map(|a| a.args).unwrap_or(&[]);
+ let args = args.map_or(<&[_]>::default(), |a| a.args);
109
110
// ty_args contains the generic parameters of the type declaration, while args contains the
111
// arguments used at instantiation time. If both len are not equal, it means that some
0 commit comments