mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
anime: prep rog-anime for publish, rename *all* AniMe~ to Anime
This commit is contained in:
@@ -3,7 +3,7 @@ use png_pong::decode::Error as PngError;
|
||||
use std::error::Error;
|
||||
use std::fmt;
|
||||
|
||||
#[cfg(feature = "z")]
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::fdo;
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -15,12 +15,12 @@ pub enum AnimeError {
|
||||
Format,
|
||||
/// The input was incorrect size, expected size is `IncorrectSize(width, height)`
|
||||
IncorrectSize(u32, u32),
|
||||
#[cfg(feature = "z")]
|
||||
#[cfg(feature = "dbus")]
|
||||
Zbus(fdo::Error)
|
||||
}
|
||||
|
||||
impl fmt::Display for AnimeError {
|
||||
// This trait requires `fmt` with this exact signature.
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
AnimeError::NoFrames => write!(f, "No frames in PNG"),
|
||||
@@ -33,7 +33,7 @@ impl fmt::Display for AnimeError {
|
||||
"The input image size is incorrect, expected {}x{}",
|
||||
width, height
|
||||
),
|
||||
#[cfg(feature = "z")]
|
||||
#[cfg(feature = "dbus")]
|
||||
AnimeError::Zbus(e) => write!(f, "ZBUS error: {}", e),
|
||||
}
|
||||
}
|
||||
@@ -42,25 +42,29 @@ impl fmt::Display for AnimeError {
|
||||
impl Error for AnimeError {}
|
||||
|
||||
impl From<std::io::Error> for AnimeError {
|
||||
#[inline]
|
||||
fn from(err: std::io::Error) -> Self {
|
||||
AnimeError::Io(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PngError> for AnimeError {
|
||||
#[inline]
|
||||
fn from(err: PngError) -> Self {
|
||||
AnimeError::Png(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<DecodingError> for AnimeError {
|
||||
#[inline]
|
||||
fn from(err: DecodingError) -> Self {
|
||||
AnimeError::Gif(err)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "z")]
|
||||
#[cfg(feature = "dbus")]
|
||||
impl From<AnimeError> for fdo::Error {
|
||||
#[inline]
|
||||
fn from(err: AnimeError) -> Self {
|
||||
fdo::Error::Failed(format!("{}", err))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user