feat(errors): remake most of the errors from thiserror to snafu

This commit is contained in:
Даниил 2025-01-09 17:20:58 +04:00
parent 05aa961431
commit 24eb77d78f
Signed by: nm17
GPG key ID: 3303B70C59145CD4
12 changed files with 868 additions and 850 deletions

View file

@ -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)
}