diff options
author | Aleksey Kladov <[email protected]> | 2020-07-31 19:07:21 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-31 19:07:21 +0100 |
commit | 6791eb9685375da94556bb910ea71f78b08be5ec (patch) | |
tree | 5b1b11a96815d381e366685bb641185e81a1c9c4 /crates/ra_assists/src/handlers/replace_let_with_if_let.rs | |
parent | d7f75db90d99216c13000681ff2c4a887451c4b2 (diff) |
Rename PalceholderPat -> WildcardPat
Diffstat (limited to 'crates/ra_assists/src/handlers/replace_let_with_if_let.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/replace_let_with_if_let.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/replace_let_with_if_let.rs b/crates/ra_assists/src/handlers/replace_let_with_if_let.rs index a49292c97..64ad15a23 100644 --- a/crates/ra_assists/src/handlers/replace_let_with_if_let.rs +++ b/crates/ra_assists/src/handlers/replace_let_with_if_let.rs | |||
@@ -62,8 +62,7 @@ pub(crate) fn replace_let_with_if_let(acc: &mut Assists, ctx: &AssistContext) -> | |||
62 | let if_ = make::expr_if(make::condition(init, Some(with_placeholder)), block); | 62 | let if_ = make::expr_if(make::condition(init, Some(with_placeholder)), block); |
63 | let stmt = make::expr_stmt(if_); | 63 | let stmt = make::expr_stmt(if_); |
64 | 64 | ||
65 | let placeholder = | 65 | let placeholder = stmt.syntax().descendants().find_map(ast::WildcardPat::cast).unwrap(); |
66 | stmt.syntax().descendants().find_map(ast::PlaceholderPat::cast).unwrap(); | ||
67 | let stmt = stmt.replace_descendant(placeholder.into(), original_pat); | 66 | let stmt = stmt.replace_descendant(placeholder.into(), original_pat); |
68 | 67 | ||
69 | edit.replace_ast(ast::Stmt::from(let_stmt), ast::Stmt::from(stmt)); | 68 | edit.replace_ast(ast::Stmt::from(let_stmt), ast::Stmt::from(stmt)); |