diff --git a/src/lib.rs b/src/lib.rs index 32bb410..ea8757b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,8 +43,8 @@ //! ``` use std::{ - char, - error, + borrow::Cow, + char, error, fmt::{self, Display}, fs::{File, OpenOptions}, io::{self, Read, Seek, SeekFrom, Write}, @@ -1169,7 +1169,7 @@ struct Parser<'a> { pub struct ParseError { pub line: usize, pub col: usize, - pub msg: String, + pub msg: Cow<'static, str>, } impl Display for ParseError { @@ -1243,7 +1243,7 @@ impl<'a> Parser<'a> { } } - fn error>(&self, msg: M) -> Result { + fn error>>(&self, msg: M) -> Result { Err(ParseError { line: self.line + 1, col: self.col + 1,