diff options
author | Lukas Wirth <[email protected]> | 2020-10-14 21:21:58 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-10-14 21:50:26 +0100 |
commit | bab29e65eb87f4765fb22d58bff723780980eeb6 (patch) | |
tree | de74eb9ddc59fd542c6aa5c14e778e1f3560cccf /crates/ide/src/syntax_highlighting.rs | |
parent | 8c6dc5f28a5550acffbbb063335833304dac266d (diff) |
Default::default the highlighters
Diffstat (limited to 'crates/ide/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs index 8ecaff204..527888306 100644 --- a/crates/ide/src/syntax_highlighting.rs +++ b/crates/ide/src/syntax_highlighting.rs | |||
@@ -74,7 +74,7 @@ pub(crate) fn highlight( | |||
74 | 74 | ||
75 | let mut current_macro_call: Option<ast::MacroCall> = None; | 75 | let mut current_macro_call: Option<ast::MacroCall> = None; |
76 | let mut format_string_highlighter = FormatStringHighlighter::default(); | 76 | let mut format_string_highlighter = FormatStringHighlighter::default(); |
77 | let mut macro_rules_highlighter = MacroRulesHighlighter::new(); | 77 | let mut macro_rules_highlighter = MacroRulesHighlighter::default(); |
78 | 78 | ||
79 | // Walk all nodes, keeping track of whether we are inside a macro or not. | 79 | // Walk all nodes, keeping track of whether we are inside a macro or not. |
80 | // If in macro, expand it first and highlight the expanded code. | 80 | // If in macro, expand it first and highlight the expanded code. |
@@ -125,8 +125,8 @@ pub(crate) fn highlight( | |||
125 | WalkEvent::Leave(Some(mc)) => { | 125 | WalkEvent::Leave(Some(mc)) => { |
126 | assert!(current_macro_call == Some(mc)); | 126 | assert!(current_macro_call == Some(mc)); |
127 | current_macro_call = None; | 127 | current_macro_call = None; |
128 | format_string_highlighter.reset(); | 128 | format_string_highlighter = FormatStringHighlighter::default(); |
129 | macro_rules_highlighter.reset(); | 129 | macro_rules_highlighter = MacroRulesHighlighter::default(); |
130 | } | 130 | } |
131 | _ => (), | 131 | _ => (), |
132 | } | 132 | } |