From 37cc45803a57ce529fdfb9ea7a210efea25fbca6 Mon Sep 17 00:00:00 2001 From: Bazaah Date: Sat, 5 Jun 2021 17:01:38 +0000 Subject: [PATCH] lib/scanner: add UnexpectedEOF error variant --- src/scanner/error.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scanner/error.rs b/src/scanner/error.rs index 68a05fa..041cf31 100644 --- a/src/scanner/error.rs +++ b/src/scanner/error.rs @@ -2,7 +2,7 @@ use std::fmt; pub type ScanResult = std::result::Result; -#[derive(Debug)] +#[derive(Debug, PartialEq, Eq)] pub enum ScanError { /// Directive was not either YAML or TAG @@ -18,6 +18,9 @@ pub enum ScanError /// A directive major or minor digit was not 0..=9 InvalidVersion, + + /// Got end of stream while parsing a token + UnexpectedEOF, } impl fmt::Display for ScanError