mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 09:27:27 +00:00
Merge #3493
3493: make::use_item r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
4173645a71
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…
Reference in a new issue