Factor out date serde into newtype
This commit is contained in:
@@ -4,6 +4,7 @@ Error handling and reporting.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::array::TryFromSliceError;
|
||||
use std::convert::Infallible;
|
||||
use std::fmt;
|
||||
use std::net::AddrParseError;
|
||||
use std::num::{ParseFloatError, ParseIntError};
|
||||
@@ -239,6 +240,12 @@ impl From<PublicError> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl ToErr for Infallible {
|
||||
fn to_err(self) -> Error {
|
||||
Error::with_msg_no_trace(String::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for Error {
|
||||
fn from(k: String) -> Self {
|
||||
Self::with_msg(k)
|
||||
|
||||
Reference in New Issue
Block a user