feat(errors): Switch Error::custom to use Into<String>

This commit is contained in:
Erick Tryzelaar
2016-02-26 21:12:16 -08:00
parent 6ea632e98b
commit ec75f22396
9 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -10,11 +10,11 @@ use serde::bytes::{ByteBuf, Bytes};
struct Error;
impl serde::ser::Error for Error {
fn custom(_: String) -> Error { Error }
fn custom<T: Into<String>>(_: T) -> Error { Error }
}
impl serde::de::Error for Error {
fn custom(_: String) -> Error { Error }
fn custom<T: Into<String>>(_: T) -> Error { Error }
fn end_of_stream() -> Error { Error }
}
+2 -2
View File
@@ -416,7 +416,7 @@ pub enum Error {
}
impl ser::Error for Error {
fn custom(_: String) -> Error { Error::SyntaxError }
fn custom<T: Into<String>>(_: T) -> Error { Error::SyntaxError }
fn invalid_value(msg: &str) -> Error {
Error::InvalidValue(msg.to_owned())
@@ -424,7 +424,7 @@ impl ser::Error for Error {
}
impl de::Error for Error {
fn custom(_: String) -> Error { Error::SyntaxError }
fn custom<T: Into<String>>(_: T) -> Error { Error::SyntaxError }
fn end_of_stream() -> Error { Error::EndOfStreamError }