mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-24 09:05:34 +00:00
internal: move make::expr_unit to make::ext::expr_unit
`expr_unit` is just a shortcut for a common expression, so it belongs in `make::ext`
This commit is contained in:
parent
f388482119
commit
905e1e1fc0
8 changed files with 18 additions and 18 deletions
|
|
@ -63,6 +63,9 @@ pub mod ext {
|
|||
Some(expr)
|
||||
}
|
||||
|
||||
pub fn expr_unit() -> ast::Expr {
|
||||
expr_tuple([]).into()
|
||||
}
|
||||
pub fn expr_unreachable() -> ast::Expr {
|
||||
expr_from_text("unreachable!()")
|
||||
}
|
||||
|
|
@ -546,10 +549,6 @@ pub fn hacky_block_expr(
|
|||
ast_from_text(&format!("fn f() {buf}"))
|
||||
}
|
||||
|
||||
pub fn expr_unit() -> ast::Expr {
|
||||
expr_from_text("()")
|
||||
}
|
||||
|
||||
pub fn expr_literal(text: &str) -> ast::Literal {
|
||||
assert_eq!(text.trim(), text);
|
||||
ast_from_text(&format!("fn f() {{ let _ = {text}; }}"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue