mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
make::use_item
This commit is contained in:
parent
13879afdd5
commit
1f84c3b18f
1 changed files with 4 additions and 0 deletions
|
@ -46,6 +46,10 @@ pub fn use_tree_list(use_trees: impl IntoIterator<Item = ast::UseTree>) -> ast::
|
||||||
ast_from_text(&format!("use {{{}}};", use_trees))
|
ast_from_text(&format!("use {{{}}};", use_trees))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn use_item(use_tree: ast::UseTree) -> ast::UseItem {
|
||||||
|
ast_from_text(&format!("use {};", use_tree.syntax()))
|
||||||
|
}
|
||||||
|
|
||||||
pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField {
|
pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField {
|
||||||
return match expr {
|
return match expr {
|
||||||
Some(expr) => from_text(&format!("{}: {}", name.syntax(), expr.syntax())),
|
Some(expr) => from_text(&format!("{}: {}", name.syntax(), expr.syntax())),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue