mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
style: prefer type inference
- unrelated to the PR but I wanted to change this in #17467
This commit is contained in:
parent
2b52bffaef
commit
120526ad68
@ -96,7 +96,7 @@ struct BoolNodeData {
|
|||||||
|
|
||||||
/// Attempts to find an appropriate node to apply the action to.
|
/// Attempts to find an appropriate node to apply the action to.
|
||||||
fn find_bool_node(ctx: &AssistContext<'_>) -> Option<BoolNodeData> {
|
fn find_bool_node(ctx: &AssistContext<'_>) -> Option<BoolNodeData> {
|
||||||
let name: ast::Name = ctx.find_node_at_offset()?;
|
let name = ctx.find_node_at_offset::<ast::Name>()?;
|
||||||
|
|
||||||
if let Some(ident_pat) = name.syntax().parent().and_then(ast::IdentPat::cast) {
|
if let Some(ident_pat) = name.syntax().parent().and_then(ast::IdentPat::cast) {
|
||||||
let def = ctx.sema.to_def(&ident_pat)?;
|
let def = ctx.sema.to_def(&ident_pat)?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user