diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-12-18 09:23:16 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-12-18 09:23:16 +0100 |
| commit | 49bd7e8e49655da83d64969a54c6281bd6c6d2fe (patch) | |
| tree | f5ab97525571efd4ace0af6089e1738002f310a4 /lib/xixanta/src/errors.rs | |
| parent | 6af3219daee1457c3b9fb03fe73d2b0019d70408 (diff) | |
| download | tools.nes-49bd7e8e49655da83d64969a54c6281bd6c6d2fe.tar.gz tools.nes-49bd7e8e49655da83d64969a54c6281bd6c6d2fe.zip | |
Remove From<std::io::Error> from errors
Having a From<std::io::Error> came from a hacky beginning in which
std::io::Error was being abused. Now the error handling is saner, so
there's no more need for that.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'lib/xixanta/src/errors.rs')
| -rw-r--r-- | lib/xixanta/src/errors.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/xixanta/src/errors.rs b/lib/xixanta/src/errors.rs index 28eaec1..d64183d 100644 --- a/lib/xixanta/src/errors.rs +++ b/lib/xixanta/src/errors.rs @@ -25,15 +25,6 @@ pub struct ParseError { impl std::error::Error for ParseError {} -impl From<std::io::Error> for ParseError { - fn from(err: std::io::Error) -> Self { - ParseError { - line: 0, - message: err.to_string(), - } - } -} - impl fmt::Display for ParseError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "parser (line {}): {}.", self.line + 1, self.message) @@ -58,17 +49,6 @@ pub struct ContextError { impl std::error::Error for ContextError {} -// TODO: needed? -impl From<std::io::Error> for ContextError { - fn from(err: std::io::Error) -> Self { - ContextError { - line: 0, - reason: ContextErrorReason::Other, - message: err.to_string(), - } - } -} - impl fmt::Display for ContextError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( @@ -89,16 +69,6 @@ pub struct EvalError { impl std::error::Error for EvalError {} -impl From<std::io::Error> for EvalError { - fn from(err: std::io::Error) -> Self { - EvalError { - line: 0, - message: err.to_string(), - global: true, - } - } -} - impl From<ContextError> for EvalError { fn from(err: ContextError) -> Self { EvalError { |
