Skip to content

Commit 2427ec2

Browse files
committed
misc: remove one level of nesting
1 parent f35c203 commit 2427ec2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

clippy_lints/src/casts/cast_ptr_alignment.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,13 @@ fn is_used_as_unaligned(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
7474
ExprKind::Call(func, [arg, ..]) if arg.hir_id == e.hir_id => {
7575
if let ExprKind::Path(path) = &func.kind
7676
&& let Some(def_id) = cx.qpath_res(path, func.hir_id).opt_def_id()
77+
&& let Some(name) = cx.tcx.get_diagnostic_name(def_id)
7778
&& matches!(
78-
cx.tcx.get_diagnostic_name(def_id),
79-
Some(
80-
sym::ptr_write_unaligned
81-
| sym::ptr_read_unaligned
82-
| sym::intrinsics_unaligned_volatile_load
83-
| sym::intrinsics_unaligned_volatile_store
84-
)
79+
name,
80+
sym::ptr_write_unaligned
81+
| sym::ptr_read_unaligned
82+
| sym::intrinsics_unaligned_volatile_load
83+
| sym::intrinsics_unaligned_volatile_store
8584
)
8685
{
8786
true

0 commit comments

Comments
 (0)