From 48b800e5c455caf4a4ae3a2ac7479b0d376a3650 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Fri, 26 Feb 2021 22:45:28 -0800 Subject: [PATCH] cleanup: fix a few things reported by upgraded rustc and clippy --- src/commands.rs | 2 +- src/template_parser.rs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 8f66b30ef..7bb21780d 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1664,7 +1664,7 @@ fn cmd_evolve<'s>( struct Listener<'a, 's> { ui: &'a mut Ui<'s>, - }; + } impl<'a, 's> EvolveListener for Listener<'a, 's> { fn orphan_evolved(&mut self, tx: &mut Transaction, orphan: &Commit, new_commit: &Commit) { diff --git a/src/template_parser.rs b/src/template_parser.rs index 2dca0eb35..58a5f0efe 100644 --- a/src/template_parser.rs +++ b/src/template_parser.rs @@ -353,10 +353,9 @@ fn parse_commit_term<'a, 'r: 'a>( None => panic!("if() requires at least two arguments"), Some(pair) => parse_commit_template_rule(repo, pair), }; - let false_template = match inner.next() { - None => None, - Some(pair) => Some(parse_commit_template_rule(repo, pair)), - }; + let false_template = inner + .next() + .map(|pair| parse_commit_template_rule(repo, pair)); if inner.next().is_some() { panic!("if() accepts at most three arguments") }