Add PartialEq to Toml::de

Add PartialEq trait to Error, ErrorInner and ErrorKind.

Relevant issue: https://github.com/alexcrichton/toml-rs/issues/291
This commit is contained in:
Abid Omar 2019-03-11 18:38:50 +01:00
parent 4a0a866fbd
commit 861a7be7d4

View file

@ -79,12 +79,12 @@ where
} }
/// Errors that can occur when deserializing a type. /// Errors that can occur when deserializing a type.
#[derive(Debug, Clone)] #[derive(Debug, PartialEq, Clone)]
pub struct Error { pub struct Error {
inner: Box<ErrorInner>, inner: Box<ErrorInner>,
} }
#[derive(Debug, Clone)] #[derive(Debug, PartialEq, Clone)]
struct ErrorInner { struct ErrorInner {
kind: ErrorKind, kind: ErrorKind,
line: Option<usize>, line: Option<usize>,
@ -94,7 +94,7 @@ struct ErrorInner {
} }
/// Errors that can occur when deserializing a type. /// Errors that can occur when deserializing a type.
#[derive(Debug, Clone)] #[derive(Debug, PartialEq, Clone)]
enum ErrorKind { enum ErrorKind {
/// EOF was reached when looking for a value /// EOF was reached when looking for a value
UnexpectedEof, UnexpectedEof,