feat(errors): remake most of the errors from thiserror to snafu
This commit is contained in:
parent
05aa961431
commit
24eb77d78f
12 changed files with 868 additions and 850 deletions
|
@ -5,7 +5,7 @@ mod hifitime_serde;
|
|||
|
||||
use phf::phf_map;
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
use std::borrow::Cow;
|
||||
use std::{borrow::Cow, sync::Arc};
|
||||
|
||||
pub use hifitime_serde::EpochUTC;
|
||||
|
||||
|
@ -83,3 +83,7 @@ static STR_TO_UNITS: phf::Map<&'static str, SupportedUnit> = phf_map! {
|
|||
"s" => SupportedUnit::Seconds,
|
||||
"KWh" => SupportedUnit::KWh,
|
||||
};
|
||||
|
||||
pub fn convert_to_arc<T: std::error::Error>(error: T) -> Arc<T> {
|
||||
Arc::new(error)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue