clippy and more formatting
diff --git a/crates/ide-assists/src/utils.rs b/crates/ide-assists/src/utils.rs
index 676937c..c7a6c2d 100644
--- a/crates/ide-assists/src/utils.rs
+++ b/crates/ide-assists/src/utils.rs
@@ -1155,17 +1155,12 @@
) -> Option<Either<ast::Struct, ast::Variant>> {
ctx.find_node_at_offset::<ast::Name>()
.and_then(|name| name.syntax().parent())
- .or(find_struct_keyword(ctx).and_then(|kw| kw.parent()))
+ .or(ctx
+ .token_at_offset()
+ .find(|leaf| matches!(leaf.kind(), STRUCT_KW))
+ .and_then(|kw| kw.parent()))
.or(ctx
.find_node_at_offset::<ast::Visibility>()
.and_then(|visibility| visibility.syntax().parent()))
.and_then(<Either<ast::Struct, ast::Variant>>::cast)
}
-
-fn find_struct_keyword(ctx: &AssistContext<'_>) -> Option<SyntaxToken> {
- // Attempt to find the token at the current cursor offset
- ctx.token_at_offset().find(|leaf| match leaf.kind() {
- STRUCT_KW => true,
- _ => false,
- })
-}