From d33198c94ffd78d55bc8df4df9bcf81d77ec5ff9 Mon Sep 17 00:00:00 2001 From: Kasper Date: Mon, 7 Oct 2024 12:27:30 +0200 Subject: [PATCH] Remove unused UniResult --- src-native/lib.rs | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src-native/lib.rs b/src-native/lib.rs index 0463dee..69c885f 100644 --- a/src-native/lib.rs +++ b/src-native/lib.rs @@ -2,7 +2,6 @@ use anyhow::{Context, Result}; use serde::de::DeserializeOwned; use std::fs::File; use std::io::BufReader; -use std::mem; use std::path::PathBuf; use std::time::{SystemTime, UNIX_EPOCH}; @@ -45,35 +44,6 @@ fn str_to_option(s: String) -> Option { } } -pub type UniResult = std::result::Result; - -pub struct UniError { - pub message: String, -} -impl From for UniError { - fn from(message: String) -> Self { - Self { message } - } -} -impl From<&str> for UniError { - fn from(message: &str) -> Self { - Self { - message: message.to_string(), - } - } -} -impl From for napi::Error { - fn from(ue: UniError) -> Self { - Self::from_reason(ue.message) - } -} -impl From for UniError { - fn from(mut n_err: napi::Error) -> Self { - let message = mem::replace(&mut n_err.reason, "".to_string()); - UniError { message } - } -} - fn path_to_json(path: PathBuf) -> Result where J: DeserializeOwned,