mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 16:45:37 +00:00
don't remove the comment token if it's last
This commit is contained in:
parent
4f3dd5bc08
commit
50c913c733
@ -1467,6 +1467,7 @@ fn make_body(
|
||||
.filter(|it| text_range.contains_range(it.text_range()))
|
||||
.map(|it| match it {
|
||||
syntax::NodeOrToken::Node(n) => {
|
||||
println!("Found node: {:?}", n);
|
||||
return syntax::NodeOrToken::try_from(rewrite_body_segment(
|
||||
ctx,
|
||||
&fun.params,
|
||||
@ -1476,6 +1477,7 @@ fn make_body(
|
||||
.unwrap()
|
||||
}
|
||||
syntax::NodeOrToken::Token(t) => {
|
||||
println!("Found token: {:?}", t);
|
||||
return syntax::NodeOrToken::try_from(t).unwrap()
|
||||
}
|
||||
})
|
||||
@ -1487,7 +1489,11 @@ fn make_body(
|
||||
elements.push(node);
|
||||
None
|
||||
})
|
||||
}
|
||||
},
|
||||
Some(token) if token.as_token().is_some() && token.as_token().unwrap().kind() == COMMENT => {
|
||||
elements.push(token);
|
||||
None
|
||||
},
|
||||
_ => None,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user