lib/scanner: add UnexpectedEOF error variant

This commit is contained in:
Paul Stemmet 2021-06-05 17:01:38 +00:00 committed by Paul Stemmet
parent 3a93cb006a
commit 8c453afcb1

View file

@ -2,7 +2,7 @@ use std::fmt;
pub type ScanResult<T> = std::result::Result<T, ScanError>; pub type ScanResult<T> = std::result::Result<T, ScanError>;
#[derive(Debug)] #[derive(Debug, PartialEq, Eq)]
pub enum ScanError pub enum ScanError
{ {
/// Directive was not either YAML or TAG /// Directive was not either YAML or TAG
@ -18,6 +18,9 @@ pub enum ScanError
/// A directive major or minor digit was not 0..=9 /// A directive major or minor digit was not 0..=9
InvalidVersion, InvalidVersion,
/// Got end of stream while parsing a token
UnexpectedEOF,
} }
impl fmt::Display for ScanError impl fmt::Display for ScanError