diff --git a/Cargo.toml b/Cargo.toml index 32e9fb28b20..e7ee98512fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -177,7 +177,6 @@ needless_doctest_main = "allow" new_without_default = "allow" non_canonical_clone_impl = "allow" non_canonical_partial_ord_impl = "allow" -search_is_some = "allow" self_named_constructors = "allow" single_match = "allow" skip_while_next = "allow" diff --git a/crates/hir-def/src/resolver.rs b/crates/hir-def/src/resolver.rs index 61117141f0a..7a9c4ea0169 100644 --- a/crates/hir-def/src/resolver.rs +++ b/crates/hir-def/src/resolver.rs @@ -239,8 +239,7 @@ impl Resolver { db: &dyn DefDatabase, visibility: &RawVisibility, ) -> Option { - let within_impl = - self.scopes().find(|scope| matches!(scope, Scope::ImplDefScope(_))).is_some(); + let within_impl = self.scopes().any(|scope| matches!(scope, Scope::ImplDefScope(_))); match visibility { RawVisibility::Module(_, _) => { let (item_map, module) = self.item_scope(); diff --git a/crates/ide/src/typing.rs b/crates/ide/src/typing.rs index b4a2dc28bbe..b8856882ed7 100644 --- a/crates/ide/src/typing.rs +++ b/crates/ide/src/typing.rs @@ -359,19 +359,16 @@ fn on_left_angle_typed(file: &SourceFile, offset: TextSize) -> Option".to_string()), is_snippet: true, - }); + }) + } else { + None } - - None } /// Adds a space after an arrow when `fn foo() { ... }` is turned into `fn foo() -> { ... }`