From c8e5944d697b33738c7ba01694dde5e360470043 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 26 Mar 2023 13:04:28 +0200 Subject: refactor: add deserializer error wrapper --- src/lib.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index f3bbc54..68af8ae 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -153,5 +153,18 @@ pub enum RegistryError /// Deserialization failed. #[error("Deserialization failed")] - DeserializationFailed(#[from] DeserializerError), + DeserializationFailed(#[from] DeserializationError), } + +impl From for RegistryError +{ + fn from(err: DeserializerError) -> Self + { + DeserializationError(err).into() + } +} + +/// Deserialization error. +#[derive(Debug, thiserror::Error)] +#[error(transparent)] +pub struct DeserializationError(#[from] DeserializerError); -- cgit v1.2.3-18-g5258