Files
continuwuity/src/core/error/serde.rs
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
311 B
Rust
Raw Normal View History

2024-08-04 08:43:53 +00:00
use std::fmt::Display;
use serde::{de, ser};
use crate::Error;
impl de::Error for Error {
fn custom<T: Display + ToString>(msg: T) -> Self { Self::SerdeDe(msg.to_string().into()) }
}
impl ser::Error for Error {
fn custom<T: Display + ToString>(msg: T) -> Self { Self::SerdeSer(msg.to_string().into()) }
}