mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-29 10:58:02 +00:00
internal: Migrate unwrap_return_type assist to use SyntaxEditor
Also changes `make::expr_empty_block()` to return `ast::BlockExpr` instead of `ast::Expr`
This commit is contained in:
parent
651b43e551
commit
a5a79f5957
4 changed files with 75 additions and 57 deletions
|
|
@ -558,8 +558,8 @@ pub fn expr_const_value(text: &str) -> ast::ConstArg {
|
|||
ast_from_text(&format!("trait Foo<const N: usize = {text}> {{}}"))
|
||||
}
|
||||
|
||||
pub fn expr_empty_block() -> ast::Expr {
|
||||
expr_from_text("{}")
|
||||
pub fn expr_empty_block() -> ast::BlockExpr {
|
||||
ast_from_text("const C: () = {};")
|
||||
}
|
||||
pub fn expr_path(path: ast::Path) -> ast::Expr {
|
||||
expr_from_text(&path.to_string())
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ impl SyntaxFactory {
|
|||
}
|
||||
|
||||
pub fn expr_empty_block(&self) -> ast::BlockExpr {
|
||||
ast::BlockExpr { syntax: make::expr_empty_block().syntax().clone_for_update() }
|
||||
make::expr_empty_block().clone_for_update()
|
||||
}
|
||||
|
||||
pub fn expr_tuple(&self, fields: impl IntoIterator<Item = ast::Expr>) -> ast::TupleExpr {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue