1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::fmt::Display;

use crate::NyarError;

impl serde::ser::Error for NyarError {
    fn custom<T>(msg: T) -> Self
    where
        T: Display,
    {
        NyarError::runtime_error(msg.to_string())
    }
}

impl serde::de::Error for NyarError {
    fn custom<T>(msg: T) -> Self
    where
        T: Display,
    {
        NyarError::runtime_error(msg.to_string())
    }
}