From 7e8568b29361c67cf185ebbf680a8e080e0c5e68 Mon Sep 17 00:00:00 2001 From: Johann Hemmann Date: Fri, 19 Jan 2024 16:07:52 +0100 Subject: [PATCH] option_map_unit_fn --- Cargo.toml | 1 - crates/hir-def/src/nameres/collector.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4086b12454..f723e08b17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -179,7 +179,6 @@ needless_doctest_main = "allow" new_without_default = "allow" non_canonical_clone_impl = "allow" non_canonical_partial_ord_impl = "allow" -option_map_unit_fn = "allow" partialeq_to_none = "allow" ptr_arg = "allow" redundant_closure = "allow" diff --git a/crates/hir-def/src/nameres/collector.rs b/crates/hir-def/src/nameres/collector.rs index 2d32373371..1c0f4d4d35 100644 --- a/crates/hir-def/src/nameres/collector.rs +++ b/crates/hir-def/src/nameres/collector.rs @@ -2371,9 +2371,9 @@ impl ModCollector<'_, '_> { }; for (name, macs) in source.scope.legacy_macros() { - macs.last().map(|&mac| { + if let Some(&mac) = macs.last() { target.scope.define_legacy_macro(name.clone(), mac); - }); + } } }