mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 20:56:49 +00:00
add serde de/ser impls for error
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
1 parent
bac795de5f
commit
efa70b9e78
2 files changed
+18
No files matched your search
@@ -0,0 +1,13 @@
|
||||
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()) }
|
||||
}
|
||||
Reference in new issue
Block a user