diff --git a/crates/math-core/src/error.rs b/crates/math-core/src/error.rs index 2cea79ca..31fbe11c 100644 --- a/crates/math-core/src/error.rs +++ b/crates/math-core/src/error.rs @@ -37,7 +37,7 @@ pub(crate) enum LatexErrKind { BoundFollowedByBound, DuplicateSubOrSup, SwitchOnlyInSequence, - ExpectedText(&'static str), + ExpectedText, ExpectedLength(Box), ExpectedColSpec(Box), ExpectedNumber(Box), @@ -163,8 +163,8 @@ impl LatexErrKind { LatexErrKind::SwitchOnlyInSequence => { write!(s, "Math variant switch command found outside of sequence.")?; } - LatexErrKind::ExpectedText(place) => { - write!(s, "Expected text in {place}.")?; + LatexErrKind::ExpectedText => { + write!(s, "Expected text in string literal.")?; } LatexErrKind::ExpectedLength(got) => { write!(s, "Expected length with units, got \"{got}\".")?; @@ -301,7 +301,7 @@ impl LatexError { LatexErrKind::BoundFollowedByBound => "unexpected bound".into(), LatexErrKind::DuplicateSubOrSup => "duplicate".into(), LatexErrKind::SwitchOnlyInSequence => "math variant switch command as argument".into(), - LatexErrKind::ExpectedText(_) => "expected text here".into(), + LatexErrKind::ExpectedText => "expected text here".into(), LatexErrKind::ExpectedLength(_) => "expected length here".into(), LatexErrKind::ExpectedNumber(_) => "expected a number here".into(), LatexErrKind::ExpectedColSpec(_) => "expected a column spec here".into(), diff --git a/crates/math-core/src/parser.rs b/crates/math-core/src/parser.rs index 3529385c..3c3861d7 100644 --- a/crates/math-core/src/parser.rs +++ b/crates/math-core/src/parser.rs @@ -1675,7 +1675,7 @@ where let Some(ch) = recover_limited_ascii(tok) else { return Err(Box::new(LatexError( span.into(), - LatexErrKind::ExpectedText("string literal"), + LatexErrKind::ExpectedText, ))); }; builder.push_char(ch);