From 16a79cd56739abd4fce575853fa5883f94f5ace9 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Sat, 23 Mar 2019 15:27:18 +0200 Subject: [PATCH] Remove serde::de::Error implementation for error::Error Serde forces us to be generic over which error our visitor returns, so we cannot return our error type. So the implementation of serde's error trait is useless to us at this state. Relates to #18 --- src/feature_serde/mod.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/feature_serde/mod.rs b/src/feature_serde/mod.rs index d2d0706..d356fde 100644 --- a/src/feature_serde/mod.rs +++ b/src/feature_serde/mod.rs @@ -1,7 +1,7 @@ +use ::Node; use interface::build_operator_tree; use serde::{de, Deserialize, Deserializer}; use std::fmt; -use ::{Error, Node}; impl<'de> Deserialize<'de> for Node { fn deserialize(deserializer: D) -> Result @@ -34,9 +34,3 @@ impl<'de> de::Visitor<'de> for NodeVisitor { } } } - -impl de::Error for Error { - fn custom(msg: T) -> Self { - Error::Custom(msg.to_string()) - } -}