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:
Giga Bowser 2024-11-17 14:03:28 -05:00
parent 651b43e551
commit a5a79f5957
4 changed files with 75 additions and 57 deletions

View file

@ -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())