From bab29e65eb87f4765fb22d58bff723780980eeb6 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 14 Oct 2020 22:21:58 +0200 Subject: Default::default the highlighters --- crates/ide/src/syntax_highlighting.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ide/src/syntax_highlighting.rs') 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( let mut current_macro_call: Option = None; let mut format_string_highlighter = FormatStringHighlighter::default(); - let mut macro_rules_highlighter = MacroRulesHighlighter::new(); + let mut macro_rules_highlighter = MacroRulesHighlighter::default(); // Walk all nodes, keeping track of whether we are inside a macro or not. // If in macro, expand it first and highlight the expanded code. @@ -125,8 +125,8 @@ pub(crate) fn highlight( WalkEvent::Leave(Some(mc)) => { assert!(current_macro_call == Some(mc)); current_macro_call = None; - format_string_highlighter.reset(); - macro_rules_highlighter.reset(); + format_string_highlighter = FormatStringHighlighter::default(); + macro_rules_highlighter = MacroRulesHighlighter::default(); } _ => (), } -- cgit v1.2.3