mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-03 10:00:19 +00:00
chore: update rustfmt config
remove 'force_multiline_blocks' config
This commit is contained in:
parent
dd3a57fbfa
commit
7ed3a16f21
@ -9,6 +9,5 @@ use_try_shorthand = true
|
|||||||
|
|
||||||
# Unstable features (nightly only)
|
# Unstable features (nightly only)
|
||||||
unstable_features = true
|
unstable_features = true
|
||||||
force_multiline_blocks = true
|
|
||||||
group_imports = "StdExternalCrate"
|
group_imports = "StdExternalCrate"
|
||||||
imports_granularity = "Crate"
|
imports_granularity = "Crate"
|
||||||
|
40
src/error.rs
40
src/error.rs
@ -145,26 +145,18 @@ impl fmt::Display for Error {
|
|||||||
impl From<std::io::Error> for Error {
|
impl From<std::io::Error> for Error {
|
||||||
fn from(err: std::io::Error) -> Self {
|
fn from(err: std::io::Error) -> Self {
|
||||||
match err.kind() {
|
match err.kind() {
|
||||||
std::io::ErrorKind::NotFound => {
|
std::io::ErrorKind::NotFound => Self::NotFound {
|
||||||
Self::NotFound {
|
error_title: err.to_string(),
|
||||||
error_title: err.to_string(),
|
},
|
||||||
}
|
std::io::ErrorKind::PermissionDenied => Self::PermissionDenied {
|
||||||
}
|
error_title: err.to_string(),
|
||||||
std::io::ErrorKind::PermissionDenied => {
|
},
|
||||||
Self::PermissionDenied {
|
std::io::ErrorKind::AlreadyExists => Self::AlreadyExists {
|
||||||
error_title: err.to_string(),
|
error_title: err.to_string(),
|
||||||
}
|
},
|
||||||
}
|
_other => Self::IoError {
|
||||||
std::io::ErrorKind::AlreadyExists => {
|
reason: err.to_string(),
|
||||||
Self::AlreadyExists {
|
},
|
||||||
error_title: err.to_string(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_other => {
|
|
||||||
Self::IoError {
|
|
||||||
reason: err.to_string(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -183,11 +175,9 @@ impl From<zip::result::ZipError> for Error {
|
|||||||
match err {
|
match err {
|
||||||
ZipError::Io(io_err) => Self::from(io_err),
|
ZipError::Io(io_err) => Self::from(io_err),
|
||||||
ZipError::InvalidArchive(filename) => Self::InvalidZipArchive(filename),
|
ZipError::InvalidArchive(filename) => Self::InvalidZipArchive(filename),
|
||||||
ZipError::FileNotFound => {
|
ZipError::FileNotFound => Self::Custom {
|
||||||
Self::Custom {
|
reason: FinalError::with_title("Unexpected error in zip archive").detail("File not found"),
|
||||||
reason: FinalError::with_title("Unexpected error in zip archive").detail("File not found"),
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
ZipError::UnsupportedArchive(filename) => Self::UnsupportedZipArchive(filename),
|
ZipError::UnsupportedArchive(filename) => Self::UnsupportedZipArchive(filename),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user