Skip to content

Commit 0146a95

Browse files
committed
Cleanup
1 parent 4a3a525 commit 0146a95

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crates/ra_assists/src/handlers/add_explicit_type.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ pub(crate) fn add_explicit_type(acc: &mut Assists, ctx: &AssistContext) -> Optio
2525
let stmt = ctx.find_node_at_offset::<LetStmt>()?;
2626
let module = ctx.sema.scope(stmt.syntax()).module()?;
2727
let expr = stmt.initializer()?;
28-
let pat = stmt.pat()?;
2928
// Must be a binding
30-
let pat = match pat {
29+
let pat = match stmt.pat()? {
3130
ast::Pat::BindPat(bind_pat) => bind_pat,
3231
_ => return None,
3332
};
@@ -46,7 +45,7 @@ pub(crate) fn add_explicit_type(acc: &mut Assists, ctx: &AssistContext) -> Optio
4645
// Assist not applicable if the type has already been specified
4746
// and it has no placeholders
4847
let ascribed_ty = stmt.ascribed_type();
49-
if let Some(ref ty) = ascribed_ty {
48+
if let Some(ty) = &ascribed_ty {
5049
if ty.syntax().descendants().find_map(ast::PlaceholderType::cast).is_none() {
5150
return None;
5251
}

0 commit comments

Comments
 (0)