rust-analyzer guided enum variant structification
This commit is contained in:
parent
35d06f9c74
commit
b08a557f80
16 changed files with 36 additions and 25 deletions
|
@ -25,12 +25,12 @@ pub fn expand(
|
|||
// FIXME - if we get deref patterns, use them to reduce duplication here
|
||||
let (item, is_stmt, ty_span) =
|
||||
if let Annotatable::Item(item) = &item
|
||||
&& let ItemKind::Static(ty, ..) = &item.kind
|
||||
&& let ItemKind::Static(ast::Static(ty, ..)) = &item.kind
|
||||
{
|
||||
(item, false, ecx.with_def_site_ctxt(ty.span))
|
||||
} else if let Annotatable::Stmt(stmt) = &item
|
||||
&& let StmtKind::Item(item) = &stmt.kind
|
||||
&& let ItemKind::Static(ty, ..) = &item.kind
|
||||
&& let ItemKind::Static(ast::Static(ty, ..)) = &item.kind
|
||||
{
|
||||
(item, true, ecx.with_def_site_ctxt(ty.span))
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue