mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-23 01:18:02 +00:00
feat(errors): Switch Error::custom to use Into<String>
This commit is contained in:
@@ -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 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user