Explorar o código

Switch to better handling method

Daniel Lockyer %!s(int64=9) %!d(string=hai) anos
pai
achega
79b4f1a6ee
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/options/view.rs

+ 1 - 1
src/options/view.rs

@@ -344,7 +344,7 @@ impl TerminalColours {
 
     /// Determine which terminal colour conditions to use.
     fn deduce(matches: &getopts::Matches) -> Result<TerminalColours, Misfire> {
-        if let Some(word) = matches.opt_str("color").or(matches.opt_str("colour")) {
+        if let Some(word) = matches.opt_str("color").or_else(|| matches.opt_str("colour")) {
             match &*word {
                 "always"              => Ok(TerminalColours::Always),
                 "auto" | "automatic"  => Ok(TerminalColours::Automatic),