diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-06 14:56:52 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-06 14:56:52 +0000 |
commit | 4173645a717ab9b7a7d9b2534e3219cacbcfb93a (patch) | |
tree | 3cf5e6e0b89172b01e82351ce106b5d46ea10250 /crates/ra_syntax/src/ast/make.rs | |
parent | 995a92814ffda2e9c4b46392c6293bbdce4b3cc1 (diff) | |
parent | 1f84c3b18fd5340dbc64bba71af85dec8198ee65 (diff) |
Merge #3493
3493: make::use_item r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast/make.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/make.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index f25b526b6..53d6fa562 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs | |||
@@ -46,6 +46,10 @@ pub fn use_tree_list(use_trees: impl IntoIterator<Item = ast::UseTree>) -> ast:: | |||
46 | ast_from_text(&format!("use {{{}}};", use_trees)) | 46 | ast_from_text(&format!("use {{{}}};", use_trees)) |
47 | } | 47 | } |
48 | 48 | ||
49 | pub fn use_item(use_tree: ast::UseTree) -> ast::UseItem { | ||
50 | ast_from_text(&format!("use {};", use_tree.syntax())) | ||
51 | } | ||
52 | |||
49 | pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField { | 53 | pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField { |
50 | return match expr { | 54 | return match expr { |
51 | Some(expr) => from_text(&format!("{}: {}", name.syntax(), expr.syntax())), | 55 | Some(expr) => from_text(&format!("{}: {}", name.syntax(), expr.syntax())), |