File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ pub(crate) fn highlight(
194
194
let token = sema. descend_into_macros ( token. clone ( ) ) ;
195
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
198
// The macros that accept a format string expand to a compiler builtin macros
199
199
// `format_args` and `format_args_nl`.
200
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 =
237
- format_string. as_ref ( ) . map ( |fs| fs == & element_to_highlight) . unwrap_or_default ( ) ;
236
+ let is_format_string = format_string. as_ref ( ) == Some ( & element_to_highlight) ;
238
237
239
238
if let Some ( ( highlight, binding_hash) ) =
240
239
highlight_element ( & sema, & mut bindings_shadow_count, element_to_highlight. clone ( ) )
@@ -245,7 +244,7 @@ pub(crate) fn highlight(
245
244
{
246
245
stack. push ( ) ;
247
246
if is_format_string {
248
- string. lex_format_specifier ( & mut |piece_range, kind| {
247
+ string. lex_format_specifier ( |piece_range, kind| {
249
248
let highlight = match kind {
250
249
FormatSpecifier :: Open
251
250
| FormatSpecifier :: Close
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ pub enum FormatSpecifier {
192
192
}
193
193
194
194
pub trait HasFormatSpecifier : AstToken {
195
- fn lex_format_specifier < F > ( & self , callback : & mut F )
195
+ fn lex_format_specifier < F > ( & self , mut callback : F )
196
196
where
197
197
F : FnMut ( TextRange , FormatSpecifier ) ,
198
198
{
You can’t perform that action at this time.
0 commit comments