-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Removes */
from block doc comments
#1630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
*/
in block doc comments*/
from block doc comments
An alternate implementation would be to provide a |
crates/ra_syntax/src/ast/traits.rs
Outdated
line[pos..].to_owned() | ||
let end = if comment.kind().shape.is_block() && line.ends_with("*/") { | ||
// FIXME: Use `nth_back` here once stable | ||
if line.chars().rev().nth(2).map(|c| c.is_whitespace()).unwrap_or(false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's check that c
s is ascii as well, otherwise this will panic on weird uicode whitespace characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use line[..line.len() - 2].trim_end()
below instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the trim_end()
on every comment line. Is there a reason we can't unconditionally do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did that in the latest commit.
@matklad is this version good to go? |
yep! bors r+ |
1630: Removes `*/` from block doc comments r=matklad a=kjeremy The trailing `/` was annoying me on hover. Co-authored-by: kjeremy <[email protected]>
Build succeeded |
The trailing
/
was annoying me on hover.