From ed3d28f2cdd84ea869129203c548c9ad12496dc5 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Sat, 24 Jun 2017 22:53:34 +0100 Subject: [PATCH] Extract common classify --- src/options/view.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/options/view.rs b/src/options/view.rs index 92a961f..861b65f 100644 --- a/src/options/view.rs +++ b/src/options/view.rs @@ -34,6 +34,8 @@ impl View { pub fn deduce(matches: &getopts::Matches, filter: FileFilter, dir_action: DirAction) -> Result { use options::misfire::Misfire::*; + let classify = Classify::deduce(matches); + let colour_scale = || { matches.opt_present("color-scale") || matches.opt_present("colour-scale") }; @@ -68,8 +70,6 @@ impl View { xattr: xattr::ENABLED && matches.opt_present("extended"), }; - let classify = Classify::deduce(matches); - Ok(View { mode: Mode::Details(details), colours, classify }) } }; @@ -96,7 +96,6 @@ impl View { }; let other_options_scan = || { - let classify = Classify::deduce(matches); let term_colours = TerminalColours::deduce(matches)?; let term_width = TerminalWidth::deduce()?;