From 7ed3a16f2165d91e53f14cfdbcdfc6fc57d00fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20M=2E=20Bezerra?= Date: Mon, 4 Jul 2022 11:06:16 -0300 Subject: [PATCH] chore: update rustfmt config remove 'force_multiline_blocks' config --- rustfmt.toml | 1 - src/error.rs | 40 +++++++++++++++------------------------- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/rustfmt.toml b/rustfmt.toml index 8a9367d..c8de962 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -9,6 +9,5 @@ use_try_shorthand = true # Unstable features (nightly only) unstable_features = true -force_multiline_blocks = true group_imports = "StdExternalCrate" imports_granularity = "Crate" diff --git a/src/error.rs b/src/error.rs index 967cb8a..8002d3e 100644 --- a/src/error.rs +++ b/src/error.rs @@ -145,26 +145,18 @@ impl fmt::Display for Error { impl From for Error { fn from(err: std::io::Error) -> Self { match err.kind() { - std::io::ErrorKind::NotFound => { - Self::NotFound { - error_title: err.to_string(), - } - } - std::io::ErrorKind::PermissionDenied => { - Self::PermissionDenied { - error_title: err.to_string(), - } - } - std::io::ErrorKind::AlreadyExists => { - Self::AlreadyExists { - error_title: err.to_string(), - } - } - _other => { - Self::IoError { - reason: err.to_string(), - } - } + std::io::ErrorKind::NotFound => Self::NotFound { + error_title: err.to_string(), + }, + std::io::ErrorKind::PermissionDenied => Self::PermissionDenied { + error_title: err.to_string(), + }, + std::io::ErrorKind::AlreadyExists => Self::AlreadyExists { + error_title: err.to_string(), + }, + _other => Self::IoError { + reason: err.to_string(), + }, } } } @@ -183,11 +175,9 @@ impl From for Error { match err { ZipError::Io(io_err) => Self::from(io_err), ZipError::InvalidArchive(filename) => Self::InvalidZipArchive(filename), - ZipError::FileNotFound => { - Self::Custom { - reason: FinalError::with_title("Unexpected error in zip archive").detail("File not found"), - } - } + ZipError::FileNotFound => Self::Custom { + reason: FinalError::with_title("Unexpected error in zip archive").detail("File not found"), + }, ZipError::UnsupportedArchive(filename) => Self::UnsupportedZipArchive(filename), } }