@@ -118,16 +118,16 @@ impl LatexErrKind {
118118 ) ?;
119119 }
120120 LatexErrKind :: DisallowedChar ( got) => {
121- write ! ( s, "Disallowed character in text group: '{}'." , got ) ?;
121+ write ! ( s, "Disallowed character in text group: '{got }'." ) ?;
122122 }
123123 LatexErrKind :: UnknownEnvironment ( environment) => {
124- write ! ( s, "Unknown environment \" {}\" ." , environment ) ?;
124+ write ! ( s, "Unknown environment \" {environment }\" ." ) ?;
125125 }
126126 LatexErrKind :: UnknownCommand ( cmd) => {
127- write ! ( s, "Unknown command \" \\ {}\" ." , cmd ) ?;
127+ write ! ( s, "Unknown command \" \\ {cmd }\" ." ) ?;
128128 }
129129 LatexErrKind :: UnknownColor ( color) => {
130- write ! ( s, "Unknown color \" {}\" ." , color ) ?;
130+ write ! ( s, "Unknown color \" {color }\" ." ) ?;
131131 }
132132 LatexErrKind :: MismatchedEnvironment { expected, got } => {
133133 write ! (
@@ -164,16 +164,16 @@ impl LatexErrKind {
164164 write ! ( s, "Math variant switch command found outside of sequence." ) ?;
165165 }
166166 LatexErrKind :: ExpectedText ( place) => {
167- write ! ( s, "Expected text in {}." , place ) ?;
167+ write ! ( s, "Expected text in {place }." ) ?;
168168 }
169169 LatexErrKind :: ExpectedLength ( got) => {
170- write ! ( s, "Expected length with units, got \" {}\" ." , got ) ?;
170+ write ! ( s, "Expected length with units, got \" {got }\" ." ) ?;
171171 }
172172 LatexErrKind :: ExpectedNumber ( got) => {
173- write ! ( s, "Expected a number, got \" {}\" ." , got ) ?;
173+ write ! ( s, "Expected a number, got \" {got }\" ." ) ?;
174174 }
175175 LatexErrKind :: ExpectedColSpec ( got) => {
176- write ! ( s, "Expected column specification, got \" {}\" ." , got ) ?;
176+ write ! ( s, "Expected column specification, got \" {got }\" ." ) ?;
177177 }
178178 LatexErrKind :: NotValidInTextMode => {
179179 write ! ( s, "Not valid in text mode." ) ?;
@@ -185,7 +185,7 @@ impl LatexErrKind {
185185 write ! ( s, "Could not extract text from the given macro." ) ?;
186186 }
187187 LatexErrKind :: InvalidMacroName ( name) => {
188- write ! ( s, "Invalid macro name: \" \\ {}\" ." , name ) ?;
188+ write ! ( s, "Invalid macro name: \" \\ {name }\" ." ) ?;
189189 }
190190 LatexErrKind :: InvalidParameterNumber => {
191191 write ! ( s, "Invalid parameter number. Must be 1-9." ) ?;
@@ -232,7 +232,7 @@ impl LatexError {
232232 "span"
233233 } ;
234234 let css_class = css_class. unwrap_or ( "math-core-error" ) ;
235- let _ = write ! ( output, r#"<{} class="{}" title=""# , tag , css_class ) ;
235+ let _ = write ! ( output, r#"<{tag } class="{css_class }" title=""# ) ;
236236 let mut err_msg = String :: new ( ) ;
237237 self . to_message ( & mut err_msg, latex) ;
238238 escape_double_quoted_html_attribute ( & mut output, & err_msg) ;
@@ -253,11 +253,11 @@ impl LatexError {
253253 /// # Arguments
254254 /// - `s`: The string to write the message into.
255255 /// - `input`: The original LaTeX input that caused the error; used to
256- /// calculate the character offset for the error position.
256+ /// calculate the character offset for the error position.
257257 pub fn to_message ( & self , s : & mut String , input : & str ) {
258258 let loc = input. floor_char_boundary ( self . 0 . start ) ;
259259 let codepoint_offset = input[ ..loc] . chars ( ) . count ( ) ;
260- let _ = write ! ( s, "{}: " , codepoint_offset ) ;
260+ let _ = write ! ( s, "{codepoint_offset }: " ) ;
261261 let _ = self . 1 . write_msg ( s) ;
262262 }
263263}
@@ -281,8 +281,9 @@ impl LatexError {
281281 )
282282 . into ( ) ,
283283 LatexErrKind :: UnmatchedClose ( _) => "no matching opening for this" . into ( ) ,
284- LatexErrKind :: ExpectedArgumentGotClose => "expected an argument here" . into ( ) ,
285- LatexErrKind :: ExpectedArgumentGotEOI => "expected an argument here" . into ( ) ,
284+ LatexErrKind :: ExpectedArgumentGotClose | LatexErrKind :: ExpectedArgumentGotEOI => {
285+ "expected an argument here" . into ( )
286+ }
286287 LatexErrKind :: ExpectedDelimiter ( _) => "expected a delimiter here" . into ( ) ,
287288 LatexErrKind :: DisallowedChar ( _) => "disallowed character" . into ( ) ,
288289 LatexErrKind :: UnknownEnvironment ( _) => "unknown environment" . into ( ) ,
0 commit comments