From 186cc8e81bf3d9eaf4e4c6a81eb05a314c8fb7b6 Mon Sep 17 00:00:00 2001 From: Sandro-Alessio Gierens Date: Fri, 22 Sep 2023 19:09:04 +0200 Subject: [PATCH] fix: replace rustfmt::skip on expressions because experimental Signed-off-by: Sandro-Alessio Gierens --- src/fs/feature/git.rs | 8 +-- src/fs/filter.rs | 4 +- src/logger.rs | 4 +- src/options/dir_action.rs | 12 ++-- src/options/error.rs | 4 +- src/options/filter.rs | 4 +- src/options/flags.rs | 1 - src/options/mod.rs | 1 + src/options/view.rs | 2 +- src/output/cell.rs | 5 +- src/output/details.rs | 15 +++-- src/output/file_name.rs | 4 +- src/output/grid_details.rs | 23 ++++--- src/output/mod.rs | 4 +- src/output/render/filetype.rs | 4 +- src/output/render/git.rs | 4 +- src/output/render/octal.rs | 35 +++++++--- src/output/render/permissions.rs | 23 +++---- src/output/table.rs | 111 +++++++++++++++---------------- src/output/time.rs | 4 +- src/output/tree.rs | 4 +- src/theme/mod.rs | 20 +++--- src/theme/ui_styles.rs | 4 +- 23 files changed, 166 insertions(+), 134 deletions(-) diff --git a/src/fs/feature/git.rs b/src/fs/feature/git.rs index 421fa803..5065563d 100644 --- a/src/fs/feature/git.rs +++ b/src/fs/feature/git.rs @@ -349,7 +349,7 @@ fn reorient(path: &Path) -> PathBuf { /// The character to display if the file has been modified, but not staged. fn working_tree_status(status: git2::Status) -> f::GitStatus { #[rustfmt::skip] - match status { + return match status { s if s.contains(git2::Status::WT_NEW) => f::GitStatus::New, s if s.contains(git2::Status::WT_MODIFIED) => f::GitStatus::Modified, s if s.contains(git2::Status::WT_DELETED) => f::GitStatus::Deleted, @@ -358,21 +358,21 @@ fn working_tree_status(status: git2::Status) -> f::GitStatus { s if s.contains(git2::Status::IGNORED) => f::GitStatus::Ignored, s if s.contains(git2::Status::CONFLICTED) => f::GitStatus::Conflicted, _ => f::GitStatus::NotModified, - } + }; } /// The character to display if the file has been modified and the change /// has been staged. fn index_status(status: git2::Status) -> f::GitStatus { #[rustfmt::skip] - match status { + return match status { s if s.contains(git2::Status::INDEX_NEW) => f::GitStatus::New, s if s.contains(git2::Status::INDEX_MODIFIED) => f::GitStatus::Modified, s if s.contains(git2::Status::INDEX_DELETED) => f::GitStatus::Deleted, s if s.contains(git2::Status::INDEX_RENAMED) => f::GitStatus::Renamed, s if s.contains(git2::Status::INDEX_TYPECHANGE) => f::GitStatus::TypeChange, _ => f::GitStatus::NotModified, - } + }; } fn current_branch(repo: &git2::Repository) -> Option { diff --git a/src/fs/filter.rs b/src/fs/filter.rs index b3580ff2..893ec74c 100644 --- a/src/fs/filter.rs +++ b/src/fs/filter.rs @@ -232,7 +232,7 @@ impl SortField { use self::SortCase::{ABCabc, AaBbCc}; #[rustfmt::skip] - match self { + return match self { Self::Unsorted => Ordering::Equal, Self::Name(ABCabc) => natord::compare(&a.name, &b.name), @@ -270,7 +270,7 @@ impl SortField { Self::strip_dot(&a.name), Self::strip_dot(&b.name) ) - } + }; } fn strip_dot(n: &str) -> &str { diff --git a/src/logger.rs b/src/logger.rs index 22ae26e4..633cd45c 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -58,11 +58,11 @@ impl log::Log for Logger { fn level(level: log::Level) -> ANSIString<'static> { #[rustfmt::skip] - match level { + return match level { log::Level::Error => Colour::Red.paint("ERROR"), log::Level::Warn => Colour::Yellow.paint("WARN"), log::Level::Info => Colour::Cyan.paint("INFO"), log::Level::Debug => Colour::Blue.paint("DEBUG"), log::Level::Trace => Colour::Fixed(245).paint("TRACE"), - } + }; } diff --git a/src/options/dir_action.rs b/src/options/dir_action.rs index 9c56115b..cd62277f 100644 --- a/src/options/dir_action.rs +++ b/src/options/dir_action.rs @@ -15,13 +15,15 @@ impl DirAction { let as_file = matches.has(&flags::LIST_DIRS)?; let tree = matches.has(&flags::TREE)?; - #[rustfmt::skip] if matches.is_strict() { // Early check for --level when it wouldn’t do anything - if ! recurse && ! tree && matches.count(&flags::LEVEL) > 0 { - return Err(OptionsError::Useless2(&flags::LEVEL, &flags::RECURSE, &flags::TREE)); - } - else if recurse && as_file { + if !recurse && !tree && matches.count(&flags::LEVEL) > 0 { + return Err(OptionsError::Useless2( + &flags::LEVEL, + &flags::RECURSE, + &flags::TREE, + )); + } else if recurse && as_file { return Err(OptionsError::Conflict(&flags::RECURSE, &flags::LIST_DIRS)); } else if tree && as_file { return Err(OptionsError::Conflict(&flags::TREE, &flags::LIST_DIRS)); diff --git a/src/options/error.rs b/src/options/error.rs index 7ef1a4d5..adc56651 100644 --- a/src/options/error.rs +++ b/src/options/error.rs @@ -71,7 +71,7 @@ impl fmt::Display for OptionsError { use crate::options::parser::TakesValue; #[rustfmt::skip] - match self { + return match self { Self::BadArgument(arg, attempt) => { if let TakesValue::Necessary(Some(values)) = arg.takes_value { write!( @@ -96,7 +96,7 @@ impl fmt::Display for OptionsError { Self::TreeAllAll => write!(f, "Option --tree is useless given --all --all"), Self::FailedParse(s, n, e) => write!(f, "Value {s:?} not valid for {n}: {e}"), Self::FailedGlobPattern(ref e) => write!(f, "Failed to parse glob pattern: {e}"), - } + }; } } diff --git a/src/options/filter.rs b/src/options/filter.rs index 2706ad13..16d5127e 100644 --- a/src/options/filter.rs +++ b/src/options/filter.rs @@ -23,14 +23,14 @@ impl FileFilter { } #[rustfmt::skip] - Ok(Self { + return Ok(Self { list_dirs_first: matches.has(&flags::DIRS_FIRST)?, flags: filter_flags, sort_field: SortField::deduce(matches)?, dot_filter: DotFilter::deduce(matches)?, ignore_patterns: IgnorePatterns::deduce(matches)?, git_ignore: GitIgnore::deduce(matches)?, - }) + }); } } diff --git a/src/options/flags.rs b/src/options/flags.rs index 9fb854c7..74f18098 100644 --- a/src/options/flags.rs +++ b/src/options/flags.rs @@ -1,4 +1,3 @@ -#![rustfmt::skip] // the entire file becomes less readable with rustfmt use crate::options::parser::{Arg, Args, TakesValue, Values}; // exa options diff --git a/src/options/mod.rs b/src/options/mod.rs index 23d7a1ab..041b44ed 100644 --- a/src/options/mod.rs +++ b/src/options/mod.rs @@ -78,6 +78,7 @@ use crate::theme::Options as ThemeOptions; mod dir_action; mod file_name; mod filter; +#[rustfmt::skip] // this module becomes unreadable with rustfmt mod flags; mod theme; mod view; diff --git a/src/options/view.rs b/src/options/view.rs index c0111213..2dde1812 100644 --- a/src/options/view.rs +++ b/src/options/view.rs @@ -351,6 +351,7 @@ impl TimeTypes { let no_time = matches.has(&flags::NO_TIME)?; + #[rustfmt::skip] let time_types = if no_time { Self { modified: false, @@ -359,7 +360,6 @@ impl TimeTypes { created: false, } } else if let Some(word) = possible_word { - #[rustfmt::skip] if modified { return Err(OptionsError::Useless(&flags::MODIFIED, true, &flags::TIME)); } else if changed { diff --git a/src/output/cell.rs b/src/output/cell.rs index 2c720e10..aff12c8d 100644 --- a/src/output/cell.rs +++ b/src/output/cell.rs @@ -64,10 +64,9 @@ impl TextCell { /// This is used in place of empty table cells, as it is easier to read /// tabular data when there is *something* in each cell. pub fn blank(style: Style) -> Self { - #[rustfmt::skip] Self { - contents: vec![ style.paint("-") ].into(), - width: DisplayWidth::from(1), + contents: vec![style.paint("-")].into(), + width: DisplayWidth::from(1), } } diff --git a/src/output/details.rs b/src/output/details.rs index 6a1c0aa5..d6c743f4 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -161,11 +161,18 @@ impl<'a> Render<'a> { let mut rows = Vec::new(); if let Some(ref table) = self.opts.table { - #[rustfmt::skip] match (self.git, self.dir) { - (Some(g), Some(d)) => if ! g.has_anything_for(&d.path) { self.git = None }, - (Some(g), None) => if ! self.files.iter().any(|f| g.has_anything_for(&f.path)) { self.git = None }, - (None, _) => {/* Keep Git how it is */}, + (Some(g), Some(d)) => { + if !g.has_anything_for(&d.path) { + self.git = None + } + } + (Some(g), None) => { + if !self.files.iter().any(|f| g.has_anything_for(&f.path)) { + self.git = None + } + } + (None, _) => { /* Keep Git how it is */ } } let mut table = Table::new(table, self.git, self.theme); diff --git a/src/output/file_name.rs b/src/output/file_name.rs index ab438a4d..91c7083a 100644 --- a/src/output/file_name.rs +++ b/src/output/file_name.rs @@ -398,7 +398,7 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> { } #[rustfmt::skip] - match self.file { + return match self.file { f if f.is_mount_point() => self.colours.mount_point(), f if f.is_directory() => self.colours.directory(), #[cfg(unix)] @@ -414,7 +414,7 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> { f if f.is_socket() => self.colours.socket(), f if ! f.is_file() => self.colours.special(), _ => self.colours.colour_file(self.file), - } + }; } /// For grid's use, to cover the case of hyperlink escape sequences diff --git a/src/output/grid_details.rs b/src/output/grid_details.rs index e638304f..de8039f7 100644 --- a/src/output/grid_details.rs +++ b/src/output/grid_details.rs @@ -96,7 +96,7 @@ impl<'a> Render<'a> { /// *n* files into each column’s table, not all of them. fn details_for_column(&self) -> DetailsRender<'a> { #[rustfmt::skip] - DetailsRender { + return DetailsRender { dir: self.dir, files: Vec::new(), theme: self.theme, @@ -106,7 +106,7 @@ impl<'a> Render<'a> { filter: self.filter, git_ignoring: self.git_ignoring, git: self.git, - } + }; } /// Create a Details render for when this grid-details render doesn’t fit @@ -115,7 +115,7 @@ impl<'a> Render<'a> { /// not available, so we downgrade. pub fn give_up(self) -> DetailsRender<'a> { #[rustfmt::skip] - DetailsRender { + return DetailsRender { dir: self.dir, files: self.files, theme: self.theme, @@ -125,7 +125,7 @@ impl<'a> Render<'a> { filter: self.filter, git_ignoring: self.git_ignoring, git: self.git, - } + }; } // This doesn’t take an IgnoreCache even though the details one does @@ -229,11 +229,18 @@ impl<'a> Render<'a> { options: &'a TableOptions, drender: &DetailsRender<'_>, ) -> (Table<'a>, Vec) { - #[rustfmt::skip] match (self.git, self.dir) { - (Some(g), Some(d)) => if ! g.has_anything_for(&d.path) { self.git = None }, - (Some(g), None) => if ! self.files.iter().any(|f| g.has_anything_for(&f.path)) { self.git = None }, - (None, _) => {/* Keep Git how it is */}, + (Some(g), Some(d)) => { + if !g.has_anything_for(&d.path) { + self.git = None + } + } + (Some(g), None) => { + if !self.files.iter().any(|f| g.has_anything_for(&f.path)) { + self.git = None + } + } + (None, _) => { /* Keep Git how it is */ } } let mut table = Table::new(options, self.git, self.theme); diff --git a/src/output/mod.rs b/src/output/mod.rs index 158d2229..b3fc57d1 100644 --- a/src/output/mod.rs +++ b/src/output/mod.rs @@ -51,9 +51,9 @@ impl TerminalWidth { // where the output goes. #[rustfmt::skip] - match self { + return match self { Self::Set(width) => Some(width), Self::Automatic => terminal_size::terminal_size().map(|(w, _)| w.0.into()), - } + }; } } diff --git a/src/output/render/filetype.rs b/src/output/render/filetype.rs index 80ab5752..64ee6bde 100644 --- a/src/output/render/filetype.rs +++ b/src/output/render/filetype.rs @@ -5,7 +5,7 @@ use crate::fs::fields as f; impl f::Type { pub fn render(self, colours: &C) -> ANSIString<'static> { #[rustfmt::skip] - match self { + return match self { Self::File => colours.normal().paint("."), Self::Directory => colours.directory().paint("d"), Self::Pipe => colours.pipe().paint("|"), @@ -14,7 +14,7 @@ impl f::Type { Self::CharDevice => colours.char_device().paint("c"), Self::Socket => colours.socket().paint("s"), Self::Special => colours.special().paint("?"), - } + }; } } diff --git a/src/output/render/git.rs b/src/output/render/git.rs index 74549c01..0035de5d 100644 --- a/src/output/render/git.rs +++ b/src/output/render/git.rs @@ -15,7 +15,7 @@ impl f::Git { impl f::GitStatus { fn render(self, colours: &dyn Colours) -> ANSIString<'static> { #[rustfmt::skip] - match self { + return match self { Self::NotModified => colours.not_modified().paint("-"), Self::New => colours.new().paint("N"), Self::Modified => colours.modified().paint("M"), @@ -24,7 +24,7 @@ impl f::GitStatus { Self::TypeChange => colours.type_change().paint("T"), Self::Ignored => colours.ignored().paint("I"), Self::Conflicted => colours.conflicted().paint("U"), - } + }; } } diff --git a/src/output/render/octal.rs b/src/output/render/octal.rs index 50534917..de7794bc 100644 --- a/src/output/render/octal.rs +++ b/src/output/render/octal.rs @@ -9,18 +9,37 @@ pub trait Render { impl Render for Option { fn render(&self, style: Style) -> TextCell { - #[rustfmt::skip] match self { Some(p) => { let perm = &p.permissions; - let octal_sticky = f::OctalPermissions::bits_to_octal(perm.setuid, perm.setgid, perm.sticky); - let octal_owner = f::OctalPermissions::bits_to_octal(perm.user_read, perm.user_write, perm.user_execute); - let octal_group = f::OctalPermissions::bits_to_octal(perm.group_read, perm.group_write, perm.group_execute); - let octal_other = f::OctalPermissions::bits_to_octal(perm.other_read, perm.other_write, perm.other_execute); + #[rustfmt::skip] + let octal_sticky = f::OctalPermissions::bits_to_octal( + perm.setuid, + perm.setgid, + perm.sticky + ); + let octal_owner = f::OctalPermissions::bits_to_octal( + perm.user_read, + perm.user_write, + perm.user_execute, + ); + let octal_group = f::OctalPermissions::bits_to_octal( + perm.group_read, + perm.group_write, + perm.group_execute, + ); + let octal_other = f::OctalPermissions::bits_to_octal( + perm.other_read, + perm.other_write, + perm.other_execute, + ); - TextCell::paint(style, format!("{octal_sticky}{octal_owner}{octal_group}{octal_other}")) - }, - None => TextCell::paint(style, "----".into()) + TextCell::paint( + style, + format!("{octal_sticky}{octal_owner}{octal_group}{octal_other}"), + ) + } + None => TextCell::paint(style, "----".into()), } } } diff --git a/src/output/render/permissions.rs b/src/output/render/permissions.rs index 5ce25d64..94f4cea1 100644 --- a/src/output/render/permissions.rs +++ b/src/output/render/permissions.rs @@ -77,17 +77,16 @@ impl RenderPermissions for Option { } }; - #[rustfmt::skip] vec![ - bit(p.user_read, "r", colours.user_read()), - bit(p.user_write, "w", colours.user_write()), + bit(p.user_read, "r", colours.user_read()), + bit(p.user_write, "w", colours.user_write()), p.user_execute_bit(colours, is_regular_file), - bit(p.group_read, "r", colours.group_read()), + bit(p.group_read, "r", colours.group_read()), bit(p.group_write, "w", colours.group_write()), p.group_execute_bit(colours), - bit(p.other_read, "r", colours.other_read()), + bit(p.other_read, "r", colours.other_read()), bit(p.other_write, "w", colours.other_write()), - p.other_execute_bit(colours) + p.other_execute_bit(colours), ] } None => iter::repeat(colours.dash().paint("-")).take(9).collect(), @@ -102,34 +101,34 @@ impl f::Permissions { is_regular_file: bool, ) -> ANSIString<'static> { #[rustfmt::skip] - match (self.user_execute, self.setuid, is_regular_file) { + return match (self.user_execute, self.setuid, is_regular_file) { (false, false, _) => colours.dash().paint("-"), (true, false, false) => colours.user_execute_other().paint("x"), (true, false, true) => colours.user_execute_file().paint("x"), (false, true, _) => colours.special_other().paint("S"), (true, true, false) => colours.special_other().paint("s"), (true, true, true) => colours.special_user_file().paint("s"), - } + }; } fn group_execute_bit(&self, colours: &C) -> ANSIString<'static> { #[rustfmt::skip] - match (self.group_execute, self.setgid) { + return match (self.group_execute, self.setgid) { (false, false) => colours.dash().paint("-"), (true, false) => colours.group_execute().paint("x"), (false, true) => colours.special_other().paint("S"), (true, true) => colours.special_other().paint("s"), - } + }; } fn other_execute_bit(&self, colours: &C) -> ANSIString<'static> { #[rustfmt::skip] - match (self.other_execute, self.sticky) { + return match (self.other_execute, self.sticky) { (false, false) => colours.dash().paint("-"), (true, false) => colours.other_execute().paint("x"), (false, true) => colours.special_other().paint("T"), (true, true) => colours.special_other().paint("t"), - } + }; } } diff --git a/src/output/table.rs b/src/output/table.rs index dd5226fc..0515f283 100644 --- a/src/output/table.rs +++ b/src/output/table.rs @@ -168,15 +168,11 @@ impl Column { #[cfg(unix)] pub fn alignment(self) -> Alignment { #[allow(clippy::wildcard_in_or_patterns)] - #[rustfmt::skip] match self { - Self::FileSize | - Self::HardLinks | - Self::Inode | - Self::Blocksize | - Self::GitStatus => Alignment::Right, - Self::Timestamp(_) | - _ => Alignment::Left, + Self::FileSize | Self::HardLinks | Self::Inode | Self::Blocksize | Self::GitStatus => { + Alignment::Right + } + Self::Timestamp(_) | _ => Alignment::Left, } } @@ -193,28 +189,27 @@ impl Column { /// Get the text that should be printed at the top, when the user elects /// to have a header row printed. pub fn header(self) -> &'static str { - #[rustfmt::skip] match self { #[cfg(unix)] - Self::Permissions => "Permissions", + Self::Permissions => "Permissions", #[cfg(windows)] - Self::Permissions => "Mode", - Self::FileSize => "Size", - Self::Timestamp(t) => t.header(), + Self::Permissions => "Mode", + Self::FileSize => "Size", + Self::Timestamp(t) => t.header(), #[cfg(unix)] - Self::Blocksize => "Blocksize", + Self::Blocksize => "Blocksize", #[cfg(unix)] - Self::User => "User", + Self::User => "User", #[cfg(unix)] - Self::Group => "Group", + Self::Group => "Group", #[cfg(unix)] - Self::HardLinks => "Links", + Self::HardLinks => "Links", #[cfg(unix)] - Self::Inode => "inode", - Self::GitStatus => "Git", + Self::Inode => "inode", + Self::GitStatus => "Git", Self::SubdirGitRepo(_) => "Repo", #[cfg(unix)] - Self::Octal => "Octal", + Self::Octal => "Octal", #[cfg(unix)] Self::SecurityContext => "Security Context", } @@ -272,12 +267,11 @@ pub enum TimeType { impl TimeType { /// Returns the text to use for a column’s heading in the columns output. pub fn header(self) -> &'static str { - #[rustfmt::skip] match self { - Self::Modified => "Date Modified", - Self::Changed => "Date Changed", - Self::Accessed => "Date Accessed", - Self::Created => "Date Created", + Self::Modified => "Date Modified", + Self::Changed => "Date Changed", + Self::Accessed => "Date Accessed", + Self::Created => "Date Created", } } } @@ -301,12 +295,11 @@ impl Default for TimeTypes { /// By default, display just the ‘modified’ time. This is the most /// common option, which is why it has this shorthand. fn default() -> Self { - #[rustfmt::skip] Self { modified: true, - changed: false, + changed: false, accessed: false, - created: false, + created: false, } } } @@ -446,22 +439,15 @@ impl<'a> Table<'a> { } fn display(&self, file: &File<'_>, column: Column, xattrs: bool) -> TextCell { - #[rustfmt::skip] match column { - Column::Permissions => { - self.permissions_plus(file, xattrs).render(self.theme) - } - Column::FileSize => { - file.size().render(self.theme, self.size_format, &self.env.numeric) - } + Column::Permissions => self.permissions_plus(file, xattrs).render(self.theme), + Column::FileSize => file + .size() + .render(self.theme, self.size_format, &self.env.numeric), #[cfg(unix)] - Column::HardLinks => { - file.links().render(self.theme, &self.env.numeric) - } + Column::HardLinks => file.links().render(self.theme, &self.env.numeric), #[cfg(unix)] - Column::Inode => { - file.inode().render(self.theme.ui.inode) - } + Column::Inode => file.inode().render(self.theme.ui.inode), #[cfg(unix)] Column::Blocksize => { file.blocksize() @@ -478,6 +464,7 @@ impl<'a> Table<'a> { .render(self.theme, &*self.env.lock_users(), self.user_format) } #[cfg(unix)] +<<<<<<< HEAD Column::SecurityContext => { file.security_context().render(self.theme) } @@ -487,23 +474,35 @@ impl<'a> Table<'a> { Column::SubdirGitRepo(status) => { self.subdir_git_repo(file, status).render(self.theme) } +======= + Column::SecurityContext => file.security_context().render(self.theme), + Column::GitStatus => self.git_status(file).render(self.theme), + Column::SubdirGitRepoStatus => self.subdir_git_repo(file, true).render(), + Column::SubdirGitRepoNoStatus => self.subdir_git_repo(file, false).render(), +>>>>>>> 516ee70a (fix: replace rustfmt::skip on expressions because experimental) #[cfg(unix)] - Column::Octal => { - self.octal_permissions(file).render(self.theme.ui.octal) - } + Column::Octal => self.octal_permissions(file).render(self.theme.ui.octal), - Column::Timestamp(TimeType::Modified) => { - file.modified_time().render(self.theme.ui.date, self.env.time_offset, self.time_format) - } - Column::Timestamp(TimeType::Changed) => { - file.changed_time().render(self.theme.ui.date, self.env.time_offset, self.time_format) - } - Column::Timestamp(TimeType::Created) => { - file.created_time().render(self.theme.ui.date, self.env.time_offset, self.time_format) - } - Column::Timestamp(TimeType::Accessed) => { - file.accessed_time().render(self.theme.ui.date, self.env.time_offset, self.time_format) - } + Column::Timestamp(TimeType::Modified) => file.modified_time().render( + self.theme.ui.date, + self.env.time_offset, + self.time_format, + ), + Column::Timestamp(TimeType::Changed) => file.changed_time().render( + self.theme.ui.date, + self.env.time_offset, + self.time_format, + ), + Column::Timestamp(TimeType::Created) => file.created_time().render( + self.theme.ui.date, + self.env.time_offset, + self.time_format, + ), + Column::Timestamp(TimeType::Accessed) => file.accessed_time().render( + self.theme.ui.date, + self.env.time_offset, + self.time_format, + ), } } diff --git a/src/output/time.rs b/src/output/time.rs index 76a35c02..262bb494 100644 --- a/src/output/time.rs +++ b/src/output/time.rs @@ -50,13 +50,13 @@ pub enum TimeFormat { impl TimeFormat { pub fn format(self, time: &DateTime) -> String { #[rustfmt::skip] - match self { + return match self { Self::DefaultFormat => default(time), Self::ISOFormat => iso(time), Self::LongISO => long(time), Self::FullISO => full(time), Self::Relative => relative(time), - } + }; } } diff --git a/src/output/tree.rs b/src/output/tree.rs index 0b50a1f8..6f91f53c 100644 --- a/src/output/tree.rs +++ b/src/output/tree.rs @@ -58,12 +58,12 @@ impl TreePart { /// (Warning: not actually ASCII) pub fn ascii_art(self) -> &'static str { #[rustfmt::skip] - match self { + return match self { Self::Edge => "├──", Self::Line => "│ ", Self::Corner => "└──", Self::Blank => " ", - } + }; } } diff --git a/src/theme/mod.rs b/src/theme/mod.rs index 170c7c4c..6000809d 100644 --- a/src/theme/mod.rs +++ b/src/theme/mod.rs @@ -205,7 +205,7 @@ struct FileTypes; impl FileStyle for FileTypes { fn get_style(&self, file: &File<'_>, theme: &Theme) -> Option