mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-13 08:12:44 +10:00
* feat: add clippy ci * fix: clippy errors * fix: ci/cd * fix: update ci packages * fix: add gtk3 to ci deps * fix: add webkit to ci deps * fix: ci deps and perms * fix: add clippy settings to lib.rs
28 lines
832 B
Rust
28 lines
832 B
Rust
use std::{fmt::Display, io, sync::mpsc::SendError};
|
|
|
|
use serde_with::SerializeDisplay;
|
|
|
|
#[derive(SerializeDisplay)]
|
|
pub enum DownloadManagerError<T> {
|
|
IOError(io::Error),
|
|
SignalError(SendError<T>),
|
|
}
|
|
impl<T> Display for DownloadManagerError<T> {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
match self {
|
|
DownloadManagerError::IOError(error) => write!(f, "{error}"),
|
|
DownloadManagerError::SignalError(send_error) => write!(f, "{send_error}"),
|
|
}
|
|
}
|
|
}
|
|
impl<T> From<SendError<T>> for DownloadManagerError<T> {
|
|
fn from(value: SendError<T>) -> Self {
|
|
DownloadManagerError::SignalError(value)
|
|
}
|
|
}
|
|
impl<T> From<io::Error> for DownloadManagerError<T> {
|
|
fn from(value: io::Error) -> Self {
|
|
DownloadManagerError::IOError(value)
|
|
}
|
|
}
|