diff options
author | Aleksey Kladov <[email protected]> | 2021-05-09 17:51:06 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-05-09 17:55:43 +0100 |
commit | 4f3c0adc5aafea465c71c85f36484da970df1ba2 (patch) | |
tree | 4cb502a6c345c3ecfb4090067ab1de2cfd69ed55 /crates/ide_assists/src/handlers/replace_let_with_if_let.rs | |
parent | 680a0d54e4d2d474ae41f4f4a95c749495a02883 (diff) |
internal: introduce `ast::make::ext` module with common shortcuts
There's a tension between keeping a well-architectured minimal
orthogonal set of constructs, and providing convenience functions.
Relieve this pressure by introducing an dedicated module for
non-orthogonal shortcuts.
This is inspired by the django.shortcuts module which serves a similar
purpose architecturally.
Diffstat (limited to 'crates/ide_assists/src/handlers/replace_let_with_if_let.rs')
-rw-r--r-- | crates/ide_assists/src/handlers/replace_let_with_if_let.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide_assists/src/handlers/replace_let_with_if_let.rs b/crates/ide_assists/src/handlers/replace_let_with_if_let.rs index be7e724b5..f811234c0 100644 --- a/crates/ide_assists/src/handlers/replace_let_with_if_let.rs +++ b/crates/ide_assists/src/handlers/replace_let_with_if_let.rs | |||
@@ -53,7 +53,7 @@ pub(crate) fn replace_let_with_if_let(acc: &mut Assists, ctx: &AssistContext) -> | |||
53 | let with_placeholder: ast::Pat = match happy_variant { | 53 | let with_placeholder: ast::Pat = match happy_variant { |
54 | None => make::wildcard_pat().into(), | 54 | None => make::wildcard_pat().into(), |
55 | Some(var_name) => make::tuple_struct_pat( | 55 | Some(var_name) => make::tuple_struct_pat( |
56 | make::path_unqualified(make::path_segment(make::name_ref(var_name))), | 56 | make::ext::ident_path(var_name), |
57 | once(make::wildcard_pat().into()), | 57 | once(make::wildcard_pat().into()), |
58 | ) | 58 | ) |
59 | .into(), | 59 | .into(), |