diff options
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/syntax_highlighting/inject.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ide/src/syntax_highlighting/inject.rs b/crates/ide/src/syntax_highlighting/inject.rs index 947cc974c..90feb6c18 100644 --- a/crates/ide/src/syntax_highlighting/inject.rs +++ b/crates/ide/src/syntax_highlighting/inject.rs | |||
@@ -277,9 +277,9 @@ pub(super) fn doc_comment(hl: &mut Highlights, sema: &Semantics<RootDatabase>, n | |||
277 | } | 277 | } |
278 | 278 | ||
279 | fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::String> { | 279 | fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::String> { |
280 | match it.literal() { | 280 | match it.expr() { |
281 | // #[doc = lit] | 281 | // #[doc = lit] |
282 | Some(lit) => match lit.kind() { | 282 | Some(ast::Expr::Literal(lit)) => match lit.kind() { |
283 | ast::LiteralKind::String(it) => Some(it), | 283 | ast::LiteralKind::String(it) => Some(it), |
284 | _ => None, | 284 | _ => None, |
285 | }, | 285 | }, |
@@ -297,6 +297,7 @@ fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::Stri | |||
297 | string.text().get(1..string.text().len() - 1).map_or(false, |it| it == text) | 297 | string.text().get(1..string.text().len() - 1).map_or(false, |it| it == text) |
298 | }) | 298 | }) |
299 | } | 299 | } |
300 | _ => return None, | ||
300 | } | 301 | } |
301 | } | 302 | } |
302 | 303 | ||