mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-28 07:58:01 +00:00
feat(de): Rename de::Error trait methods
This commit is contained in:
@@ -10,19 +10,13 @@ use serde::bytes::{ByteBuf, Bytes};
|
||||
struct Error;
|
||||
|
||||
impl serde::ser::Error for Error {
|
||||
fn syntax(_: &str) -> Error { Error }
|
||||
|
||||
fn invalid_value(_field: &str) -> Error { Error }
|
||||
fn custom(_: String) -> Error { Error }
|
||||
}
|
||||
|
||||
impl serde::de::Error for Error {
|
||||
fn syntax(_: &str) -> Error { Error }
|
||||
fn custom(_: String) -> Error { Error }
|
||||
|
||||
fn end_of_stream() -> Error { Error }
|
||||
|
||||
fn unknown_field(_field: &str) -> Error { Error }
|
||||
|
||||
fn missing_field(_field: &'static str) -> Error { Error }
|
||||
}
|
||||
|
||||
impl fmt::Display for Error {
|
||||
|
||||
@@ -416,7 +416,7 @@ pub enum Error {
|
||||
}
|
||||
|
||||
impl ser::Error for Error {
|
||||
fn syntax(_: &str) -> Error { Error::SyntaxError }
|
||||
fn custom(_: String) -> 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 syntax(_: &str) -> Error { Error::SyntaxError }
|
||||
fn custom(_: String) -> Error { Error::SyntaxError }
|
||||
|
||||
fn end_of_stream() -> Error { Error::EndOfStreamError }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user