mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-24 09:05:34 +00:00
Merge pull request #19568 from snprajwal/destructure-struct-editor
refactor: editor for `destructure_struct_binding`
This commit is contained in:
commit
7fc29a99ef
4 changed files with 76 additions and 99 deletions
|
|
@ -643,8 +643,8 @@ pub fn expr_method_call(
|
|||
) -> ast::MethodCallExpr {
|
||||
expr_from_text(&format!("{receiver}.{method}{arg_list}"))
|
||||
}
|
||||
pub fn expr_macro_call(f: ast::Expr, arg_list: ast::ArgList) -> ast::Expr {
|
||||
expr_from_text(&format!("{f}!{arg_list}"))
|
||||
pub fn expr_macro(path: ast::Path, arg_list: ast::ArgList) -> ast::MacroExpr {
|
||||
expr_from_text(&format!("{path}!{arg_list}"))
|
||||
}
|
||||
pub fn expr_ref(expr: ast::Expr, exclusive: bool) -> ast::Expr {
|
||||
expr_from_text(&if exclusive { format!("&mut {expr}") } else { format!("&{expr}") })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue