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| {
|
||||
match e.kind() {
|
||||
io::ErrorKind::NotFound => Error::FileNotFoundError(config_file.into()),
|
||||
io::ErrorKind::PermissionDenied => Error::PermissionDeniedError(),
|
||||
io::ErrorKind::NotFound => Error::FileNotFound(config_file.into()),
|
||||
io::ErrorKind::PermissionDenied => Error::PermissionDenied(),
|
||||
_ => e.into(),
|
||||
}
|
||||
})?;
|
||||
@@ -71,21 +71,21 @@ impl Config {
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)] // we use Debug, so inner fields are never read
|
||||
pub enum Error {
|
||||
FileNotFoundError(String),
|
||||
PermissionDeniedError(),
|
||||
InvalidFormatError(serde_yaml::Error),
|
||||
IoError(io::Error),
|
||||
FileNotFound(String),
|
||||
PermissionDenied(),
|
||||
InvalidFormat(serde_yaml::Error),
|
||||
Io(io::Error),
|
||||
}
|
||||
|
||||
impl From<serde_yaml::Error> for Error {
|
||||
fn from(e: serde_yaml::Error) -> Self {
|
||||
Self::InvalidFormatError(e)
|
||||
Self::InvalidFormat(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<io::Error> for Error {
|
||||
fn from(e: io::Error) -> Self {
|
||||
Self::IoError(e)
|
||||
Self::Io(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user