Skip to content

Commit 86bfdf3

Browse files
nbdd0121jwnrt
authored andcommitted
Make ParseError boxed
Clippy complains that the error type is too large (184 bytes). Signed-off-by: Gary Guo <[email protected]>
1 parent 43c70e6 commit 86bfdf3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/error.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ pub enum Error {
1717
#[error("unhandled escape: `\\{0}`")]
1818
EscapeError(char),
1919
#[error("formatter error: {0:?}")]
20-
FmtError(std::fmt::Error),
20+
FmtError(#[from] std::fmt::Error),
2121
#[error("Hexdump error: {0}")]
2222
HexdumpError(String),
2323
#[error("Type {0:?} is not valid as a mapping key")]
2424
KeyTypeError(&'static str),
2525
#[error(transparent)]
26-
ParseError(#[from] ParseError),
26+
ParseError(Box<ParseError>),
2727
#[error(transparent)]
2828
ParseBoolError(#[from] ParseBoolError),
2929
#[error(transparent)]
@@ -48,8 +48,8 @@ impl de::Error for Error {
4848
}
4949
}
5050

51-
impl From<std::fmt::Error> for Error {
52-
fn from(e: std::fmt::Error) -> Self {
53-
Error::FmtError(e)
51+
impl From<ParseError> for Error {
52+
fn from(e: ParseError) -> Self {
53+
Error::ParseError(Box::new(e))
5454
}
5555
}

0 commit comments

Comments
 (0)