aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r--crates/ra_ide/src/syntax_highlighting.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs
index e29f65a78..4527885e9 100644
--- a/crates/ra_ide/src/syntax_highlighting.rs
+++ b/crates/ra_ide/src/syntax_highlighting.rs
@@ -730,8 +730,9 @@ fn highlight_name(
730 let is_unsafe = name_ref 730 let is_unsafe = name_ref
731 .and_then(|name_ref| name_ref.syntax().parent()) 731 .and_then(|name_ref| name_ref.syntax().parent())
732 .and_then(ast::MethodCallExpr::cast) 732 .and_then(ast::MethodCallExpr::cast)
733 .and_then(|method_call_expr| sema.is_unsafe_method_call(method_call_expr)); 733 .map(|method_call_expr| sema.is_unsafe_method_call(method_call_expr))
734 if is_unsafe.is_some() { 734 .unwrap_or(false);
735 if is_unsafe {
735 h |= HighlightModifier::Unsafe; 736 h |= HighlightModifier::Unsafe;
736 } 737 }
737 } 738 }
@@ -809,9 +810,9 @@ fn highlight_name_ref_by_syntax(name: ast::NameRef, sema: &Semantics<RootDatabas
809 METHOD_CALL_EXPR => { 810 METHOD_CALL_EXPR => {
810 let mut h = Highlight::new(HighlightTag::Function); 811 let mut h = Highlight::new(HighlightTag::Function);
811 let is_unsafe = ast::MethodCallExpr::cast(parent) 812 let is_unsafe = ast::MethodCallExpr::cast(parent)
812 .and_then(|method_call_expr| sema.is_unsafe_method_call(method_call_expr)); 813 .map(|method_call_expr| sema.is_unsafe_method_call(method_call_expr))
813 814 .unwrap_or(false);
814 if is_unsafe.is_some() { 815 if is_unsafe {
815 h |= HighlightModifier::Unsafe; 816 h |= HighlightModifier::Unsafe;
816 } 817 }
817 818