@@ -921,7 +921,7 @@ impl<'a, 'tcx> TagIterator<'a, 'tcx> {
921
921
Self { inner : data. char_indices ( ) . peekable ( ) , data, is_in_attribute_block : false , extra }
922
922
}
923
923
924
- fn emit_error ( & self , err : & str ) {
924
+ fn emit_error ( & self , err : impl Into < DiagnosticMessage > ) {
925
925
if let Some ( extra) = self . extra {
926
926
extra. error_invalid_codeblock_attr ( err) ;
927
927
}
@@ -954,7 +954,7 @@ impl<'a, 'tcx> TagIterator<'a, 'tcx> {
954
954
} else {
955
955
let class = & self . data [ start + 1 ..pos] ;
956
956
if class. is_empty ( ) {
957
- self . emit_error ( & format ! ( "unexpected `{c}` character after `.`" ) ) ;
957
+ self . emit_error ( format ! ( "unexpected `{c}` character after `.`" ) ) ;
958
958
return None ;
959
959
} else if self . check_after_token ( ) {
960
960
return Some ( LangStringToken :: ClassAttribute ( class) ) ;
@@ -995,7 +995,7 @@ impl<'a, 'tcx> TagIterator<'a, 'tcx> {
995
995
996
996
if let Some ( ( _, c) ) = self . inner . next ( ) {
997
997
if c != '=' {
998
- self . emit_error ( & format ! ( "expected `=`, found `{}`" , c) ) ;
998
+ self . emit_error ( format ! ( "expected `=`, found `{}`" , c) ) ;
999
999
return None ;
1000
1000
}
1001
1001
} else {
@@ -1006,7 +1006,7 @@ impl<'a, 'tcx> TagIterator<'a, 'tcx> {
1006
1006
Some ( ( pos, '"' ) ) => self . parse_string ( pos) ?,
1007
1007
Some ( ( pos, c) ) if is_bareword_char ( c) => self . parse_token ( pos) ?,
1008
1008
Some ( ( _, c) ) => {
1009
- self . emit_error ( & format ! ( "unexpected `{c}` character after `=`" ) ) ;
1009
+ self . emit_error ( format ! ( "unexpected `{c}` character after `=`" ) ) ;
1010
1010
return None ;
1011
1011
}
1012
1012
None => {
@@ -1033,7 +1033,7 @@ impl<'a, 'tcx> TagIterator<'a, 'tcx> {
1033
1033
if c == '}' || is_separator ( c) || c == '(' {
1034
1034
true
1035
1035
} else {
1036
- self . emit_error ( & format ! ( "unexpected `{c}` character" ) ) ;
1036
+ self . emit_error ( format ! ( "unexpected `{c}` character" ) ) ;
1037
1037
false
1038
1038
}
1039
1039
} else {
@@ -1052,7 +1052,7 @@ impl<'a, 'tcx> TagIterator<'a, 'tcx> {
1052
1052
} else if c == '"' || is_bareword_char ( c) {
1053
1053
return self . parse_key_value ( c, pos) ;
1054
1054
} else {
1055
- self . emit_error ( & format ! ( "unexpected character `{c}`" ) ) ;
1055
+ self . emit_error ( format ! ( "unexpected character `{c}`" ) ) ;
1056
1056
return None ;
1057
1057
}
1058
1058
}
@@ -1080,7 +1080,7 @@ impl<'a, 'tcx> TagIterator<'a, 'tcx> {
1080
1080
}
1081
1081
let indices = self . parse_string ( pos) ?;
1082
1082
if let Some ( ( _, c) ) = self . inner . peek ( ) . copied ( ) && c != '{' && !is_separator ( c) && c != '(' {
1083
- self . emit_error ( & format ! ( "expected ` `, `{{` or `,` after `\" `, found `{c}`" ) ) ;
1083
+ self . emit_error ( format ! ( "expected ` `, `{{` or `,` after `\" `, found `{c}`" ) ) ;
1084
1084
return None ;
1085
1085
}
1086
1086
return Some ( LangStringToken :: LangToken ( & self . data [ indices. start ..indices. end ] ) ) ;
@@ -1103,7 +1103,7 @@ impl<'a, 'tcx> TagIterator<'a, 'tcx> {
1103
1103
}
1104
1104
return self . next ( ) ;
1105
1105
} else {
1106
- self . emit_error ( & format ! ( "unexpected character `{c}`" ) ) ;
1106
+ self . emit_error ( format ! ( "unexpected character `{c}`" ) ) ;
1107
1107
return None ;
1108
1108
}
1109
1109
}
0 commit comments