src: config: Make clippy happy by renaming error enum variants
This commit is contained in:
+8
-8
@@ -56,8 +56,8 @@ impl Config {
|
|||||||
|
|
||||||
let serialized_config = fs::read_to_string(config_file).map_err(|e| {
|
let serialized_config = fs::read_to_string(config_file).map_err(|e| {
|
||||||
match e.kind() {
|
match e.kind() {
|
||||||
io::ErrorKind::NotFound => Error::FileNotFoundError(config_file.into()),
|
io::ErrorKind::NotFound => Error::FileNotFound(config_file.into()),
|
||||||
io::ErrorKind::PermissionDenied => Error::PermissionDeniedError(),
|
io::ErrorKind::PermissionDenied => Error::PermissionDenied(),
|
||||||
_ => e.into(),
|
_ => e.into(),
|
||||||
}
|
}
|
||||||
})?;
|
})?;
|
||||||
@@ -71,21 +71,21 @@ impl Config {
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[allow(dead_code)] // we use Debug, so inner fields are never read
|
#[allow(dead_code)] // we use Debug, so inner fields are never read
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
FileNotFoundError(String),
|
FileNotFound(String),
|
||||||
PermissionDeniedError(),
|
PermissionDenied(),
|
||||||
InvalidFormatError(serde_yaml::Error),
|
InvalidFormat(serde_yaml::Error),
|
||||||
IoError(io::Error),
|
Io(io::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<serde_yaml::Error> for Error {
|
impl From<serde_yaml::Error> for Error {
|
||||||
fn from(e: serde_yaml::Error) -> Self {
|
fn from(e: serde_yaml::Error) -> Self {
|
||||||
Self::InvalidFormatError(e)
|
Self::InvalidFormat(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<io::Error> for Error {
|
impl From<io::Error> for Error {
|
||||||
fn from(e: io::Error) -> Self {
|
fn from(e: io::Error) -> Self {
|
||||||
Self::IoError(e)
|
Self::Io(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user