Skip to content

Commit 0b7431e

Browse files
committed
Apply map_unwrap_or to Clippy itself
1 parent 6375703 commit 0b7431e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/derivable_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn check_struct<'tcx>(
105105
if let TyKind::Path(QPath::Resolved(_, p)) = self_ty.kind
106106
&& let Some(PathSegment { args, .. }) = p.segments.last()
107107
{
108-
let args = args.map(|a| a.args).unwrap_or(&[]);
108+
let args = args.map_or(<&[_]>::default(), |a| a.args);
109109

110110
// ty_args contains the generic parameters of the type declaration, while args contains the
111111
// arguments used at instantiation time. If both len are not equal, it means that some

0 commit comments

Comments
 (0)