Skip to content

Commit 60706fc

Browse files
committed
Remove dead code
1 parent ac4b134 commit 60706fc

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

crates/syntax/src/ast/make.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,6 @@ fn expr_from_text(text: &str) -> ast::Expr {
144144
ast_from_text(&format!("const C: () = {};", text))
145145
}
146146

147-
pub fn try_expr_from_text(text: &str) -> Option<ast::Expr> {
148-
try_ast_from_text(&format!("const C: () = {};", text))
149-
}
150-
151147
pub fn condition(expr: ast::Expr, pattern: Option<ast::Pat>) -> ast::Condition {
152148
match pattern {
153149
None => ast_from_text(&format!("const _: () = while {} {{}};", expr)),
@@ -332,16 +328,6 @@ fn ast_from_text<N: AstNode>(text: &str) -> N {
332328
node
333329
}
334330

335-
fn try_ast_from_text<N: AstNode>(text: &str) -> Option<N> {
336-
let parse = SourceFile::parse(text);
337-
let node = parse.tree().syntax().descendants().find_map(N::cast)?;
338-
let node = node.syntax().clone();
339-
let node = unroot(node);
340-
let node = N::cast(node).unwrap();
341-
assert_eq!(node.syntax().text_range().start(), 0.into());
342-
Some(node)
343-
}
344-
345331
fn unroot(n: SyntaxNode) -> SyntaxNode {
346332
SyntaxNode::new_root(n.green().clone())
347333
}

0 commit comments

Comments
 (0)