mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
removing unwraps
This commit is contained in:
parent
50c913c733
commit
4896ffb65c
3 changed files with 30 additions and 34 deletions
|
@ -335,14 +335,15 @@ pub fn block_expr_full(
|
|||
) -> ast::BlockExpr {
|
||||
let mut buf = "{\n".to_string();
|
||||
for stmt in stmts.into_iter() {
|
||||
|
||||
match stmt {
|
||||
rowan::NodeOrToken::Node(n) => {
|
||||
println!("Node: {:?}", n.text());
|
||||
format_to!(buf, " {}\n", n)
|
||||
},
|
||||
rowan::NodeOrToken::Token(t) if t.kind() == SyntaxKind::COMMENT => format_to!(buf, " {}\n", t),
|
||||
_ => ()
|
||||
}
|
||||
rowan::NodeOrToken::Token(t) if t.kind() == SyntaxKind::COMMENT => {
|
||||
format_to!(buf, " {}\n", t)
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
if let Some(tail_expr) = tail_expr {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue