diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-01-01 16:52:14 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-01-01 16:52:14 -0500 |
commit | ab79e981a0bcf6cd0670395bf0ee1877df2c2bc3 (patch) | |
tree | 8849ea1d8a27453ace9bfcce5a9b5f8c3341a54f /src/parse.rs | |
parent | 8bddddae5b86b79236ab760f62ecf32911b62802 (diff) | |
download | nbsh-ab79e981a0bcf6cd0670395bf0ee1877df2c2bc3.tar.gz nbsh-ab79e981a0bcf6cd0670395bf0ee1877df2c2bc3.zip |
clean up pipe code
Diffstat (limited to 'src/parse.rs')
-rw-r--r-- | src/parse.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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) + } +} |