From dff53b1200f12b1854a7e559d9d5986855bfd91f Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Wed, 14 Dec 2022 14:30:53 +0900 Subject: [PATCH] cli: simplify match arms in diff_format_for() --- src/diff_util.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/diff_util.rs b/src/diff_util.rs index 3ab24966c..e1a2bcf0d 100644 --- a/src/diff_util.rs +++ b/src/diff_util.rs @@ -60,10 +60,10 @@ pub fn diff_format_for(ui: &Ui, args: &DiffFormatArgs) -> DiffFormat { } else if args.color_words { DiffFormat::ColorWords } else { - match ui.settings().config().get_string("diff.format") { - Ok(value) if &value == "summary" => DiffFormat::Summary, - Ok(value) if &value == "git" => DiffFormat::Git, - Ok(value) if &value == "color-words" => DiffFormat::ColorWords, + match ui.settings().config().get_string("diff.format").as_deref() { + Ok("summary") => DiffFormat::Summary, + Ok("git") => DiffFormat::Git, + Ok("color-words") => DiffFormat::ColorWords, _ => DiffFormat::ColorWords, } }