aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
diff options
context:
space:
mode:
authorLeander Tentrup <[email protected]>2020-04-22 09:08:46 +0100
committerLeander Tentrup <[email protected]>2020-04-22 09:18:46 +0100
commitb2829a52161bc414f3b361c06b66633a234bba16 (patch)
tree5c2ec7a4766ec5e24060758e0fc8f059a536a0c6 /crates/ra_ide/src
parentac798e1f7cfbc6d27c87bb28e3f1d5b6801796aa (diff)
Apply suggestions from code review
Co-Authored-By: bjorn3 <[email protected]>
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r--crates/ra_ide/src/syntax_highlighting.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs
index e342ca9df..8ee3a78c6 100644
--- a/crates/ra_ide/src/syntax_highlighting.rs
+++ b/crates/ra_ide/src/syntax_highlighting.rs
@@ -194,7 +194,7 @@ pub(crate) fn highlight(
194 let token = sema.descend_into_macros(token.clone()); 194 let token = sema.descend_into_macros(token.clone());
195 let parent = token.parent(); 195 let parent = token.parent();
196 196
197 // Check if macro takes a format string and remeber it for highlighting later. 197 // Check if macro takes a format string and remember it for highlighting later.
198 // The macros that accept a format string expand to a compiler builtin macros 198 // The macros that accept a format string expand to a compiler builtin macros
199 // `format_args` and `format_args_nl`. 199 // `format_args` and `format_args_nl`.
200 if let Some(fmt_macro_call) = parent.parent().and_then(ast::MacroCall::cast) { 200 if let Some(fmt_macro_call) = parent.parent().and_then(ast::MacroCall::cast) {
@@ -233,8 +233,7 @@ pub(crate) fn highlight(
233 } 233 }
234 } 234 }
235 235
236 let is_format_string = 236 let is_format_string = format_string.as_ref() == Some(&element_to_highlight);
237 format_string.as_ref().map(|fs| fs == &element_to_highlight).unwrap_or_default();
238 237
239 if let Some((highlight, binding_hash)) = 238 if let Some((highlight, binding_hash)) =
240 highlight_element(&sema, &mut bindings_shadow_count, element_to_highlight.clone()) 239 highlight_element(&sema, &mut bindings_shadow_count, element_to_highlight.clone())
@@ -245,7 +244,7 @@ pub(crate) fn highlight(
245 { 244 {
246 stack.push(); 245 stack.push();
247 if is_format_string { 246 if is_format_string {
248 string.lex_format_specifier(&mut |piece_range, kind| { 247 string.lex_format_specifier(|piece_range, kind| {
249 let highlight = match kind { 248 let highlight = match kind {
250 FormatSpecifier::Open 249 FormatSpecifier::Open
251 | FormatSpecifier::Close 250 | FormatSpecifier::Close