diff options
author | Benjamin Coenen <[email protected]> | 2020-05-02 19:27:02 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-05-02 19:27:02 +0100 |
commit | 4613497a7714c6cd87166e6525d764d75f8acefd (patch) | |
tree | 2527ae2c0ef2ef100efee3fcb8899f8e34d0d573 /crates/ra_syntax/src/ast/make.rs | |
parent | 19e28888aa41b2845b47adb7314aed99d3c48679 (diff) | |
parent | 89e1f97515c36ab97bd378d972cabec0feb6d77e (diff) |
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer into fix_4202
Diffstat (limited to 'crates/ra_syntax/src/ast/make.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/make.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index ee0f5cc40..7b17fef49 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs | |||
@@ -22,8 +22,7 @@ pub fn path_unqualified(segment: ast::PathSegment) -> ast::Path { | |||
22 | pub fn path_qualified(qual: ast::Path, segment: ast::PathSegment) -> ast::Path { | 22 | pub fn path_qualified(qual: ast::Path, segment: ast::PathSegment) -> ast::Path { |
23 | path_from_text(&format!("{}::{}", qual, segment)) | 23 | path_from_text(&format!("{}::{}", qual, segment)) |
24 | } | 24 | } |
25 | 25 | fn path_from_text(text: &str) -> ast::Path { | |
26 | pub fn path_from_text(text: &str) -> ast::Path { | ||
27 | ast_from_text(text) | 26 | ast_from_text(text) |
28 | } | 27 | } |
29 | 28 | ||
@@ -83,14 +82,6 @@ pub fn block_expr( | |||
83 | ast_from_text(&format!("fn f() {}", buf)) | 82 | ast_from_text(&format!("fn f() {}", buf)) |
84 | } | 83 | } |
85 | 84 | ||
86 | pub fn block_from_expr(e: ast::Expr) -> ast::Block { | ||
87 | return from_text(&format!("{{ {} }}", e)); | ||
88 | |||
89 | fn from_text(text: &str) -> ast::Block { | ||
90 | ast_from_text(&format!("fn f() {}", text)) | ||
91 | } | ||
92 | } | ||
93 | |||
94 | pub fn expr_unit() -> ast::Expr { | 85 | pub fn expr_unit() -> ast::Expr { |
95 | expr_from_text("()") | 86 | expr_from_text("()") |
96 | } | 87 | } |