[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Remove unused UniResult

Kasper (Oct 7, 2024, 12:29 PM +0200) d33198c9 31cd08e6

-30
-30
src-native/lib.rs
··· 2 2 use serde::de::DeserializeOwned; 3 3 use std::fs::File; 4 4 use std::io::BufReader; 5 - use std::mem; 6 5 use std::path::PathBuf; 7 6 use std::time::{SystemTime, UNIX_EPOCH}; 8 7 ··· 42 41 match s.as_str() { 43 42 "" => None, 44 43 _ => Some(s), 45 - } 46 - } 47 - 48 - pub type UniResult<T> = std::result::Result<T, UniError>; 49 - 50 - pub struct UniError { 51 - pub message: String, 52 - } 53 - impl From<String> for UniError { 54 - fn from(message: String) -> Self { 55 - Self { message } 56 - } 57 - } 58 - impl From<&str> for UniError { 59 - fn from(message: &str) -> Self { 60 - Self { 61 - message: message.to_string(), 62 - } 63 - } 64 - } 65 - impl From<UniError> for napi::Error { 66 - fn from(ue: UniError) -> Self { 67 - Self::from_reason(ue.message) 68 - } 69 - } 70 - impl From<napi::Error> for UniError { 71 - fn from(mut n_err: napi::Error) -> Self { 72 - let message = mem::replace(&mut n_err.reason, "".to_string()); 73 - UniError { message } 74 44 } 75 45 } 76 46