Switch to better handling method

This commit is contained in:
Daniel Lockyer 2017-03-31 17:12:01 +01:00
parent ec84f16da7
commit 79b4f1a6ee

View File

@ -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),