From ab79e981a0bcf6cd0670395bf0ee1877df2c2bc3 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 1 Jan 2022 16:52:14 -0500 Subject: clean up pipe code --- src/parse.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/parse.rs') diff --git a/src/parse.rs b/src/parse.rs index 526b6ce..0249d7f 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -155,3 +155,15 @@ impl Error { &self.e } } + +impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "failed to parse {}: {}", self.input, self.e) + } +} + +impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + Some(&*self.e) + } +} -- cgit v1.2.3-54-g00ecf