diff options
| author | Tolmachev Igor <me@igorek.dev> | 2026-05-08 15:25:55 +0300 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2026-05-08 15:25:55 +0300 |
| commit | 58b937521f3e459089c0d475551bf9a49f930657 (patch) | |
| tree | 3c7e33c914445e3b6448ffc287cf70038c5e080c /compiler/src/lexer/error.rs | |
| parent | 558c5dcaf7bcc32cfe5672c4113962e3bcd19188 (diff) | |
| download | crisp-58b937521f3e459089c0d475551bf9a49f930657.tar.gz crisp-58b937521f3e459089c0d475551bf9a49f930657.zip | |
Fold unclosed string error into Token variant
UnclosedString was the only error variant, making lexer::Error redundant. Also removes Result from
the Iterator impl.
Diffstat (limited to 'compiler/src/lexer/error.rs')
| -rw-r--r-- | compiler/src/lexer/error.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/compiler/src/lexer/error.rs b/compiler/src/lexer/error.rs deleted file mode 100644 index f251167..0000000 --- a/compiler/src/lexer/error.rs +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | use std::{error, fmt, result}; | ||
| 2 | |||
| 3 | pub type Result<T> = result::Result<T, Error>; | ||
| 4 | |||
| 5 | #[derive(Debug, PartialEq, Eq)] | ||
| 6 | pub enum Error { | ||
| 7 | UnclosedString, | ||
| 8 | } | ||
| 9 | |||
| 10 | impl fmt::Display for Error { | ||
| 11 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
| 12 | match self { | ||
| 13 | Error::UnclosedString => write!(f, "unclosed string literal"), | ||
| 14 | } | ||
| 15 | } | ||
| 16 | } | ||
| 17 | |||
| 18 | impl error::Error for Error {} | ||
