diff options
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r-- | crates/ra_syntax/src/ast/traits.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs index f99984fe0..f8cf1e3eb 100644 --- a/crates/ra_syntax/src/ast/traits.rs +++ b/crates/ra_syntax/src/ast/traits.rs | |||
@@ -126,8 +126,8 @@ pub trait DocCommentsOwner: AstNode { | |||
126 | 126 | ||
127 | // Determine if the prefix or prefix + 1 char is stripped | 127 | // Determine if the prefix or prefix + 1 char is stripped |
128 | let pos = | 128 | let pos = |
129 | if line.chars().nth(prefix_len).map(|c| c.is_whitespace()).unwrap_or(false) { | 129 | if let Some(ws) = line.chars().nth(prefix_len).filter(|c| c.is_whitespace()) { |
130 | prefix_len + 1 | 130 | prefix_len + ws.len_utf8() |
131 | } else { | 131 | } else { |
132 | prefix_len | 132 | prefix_len |
133 | }; | 133 | }; |