From 59035c4532110a9fec8309bbda55d8ba6d14ce94 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 27 Jan 2025 00:01:08 +0100 Subject: Make clippy happy --- server/src/git.rs | 4 ++-- server/src/githook.rs | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'server/src') diff --git a/server/src/git.rs b/server/src/git.rs index ade66cb..58d2fda 100644 --- a/server/src/git.rs +++ b/server/src/git.rs @@ -278,13 +278,13 @@ impl RepoData { async fn get_author(&self, repo: &Repository, commit: &str) -> Result { self.get_log_format(repo, commit, "%an%n%al%n%ae") - .map_ok(|output| parse_user(output)) + .map_ok(parse_user) .await } async fn get_commiter(&self, repo: &Repository, commit: &str) -> Result { self.get_log_format(repo, commit, "%cn%n%cl%n%ce") - .map_ok(|output| parse_user(output)) + .map_ok(parse_user) .await } diff --git a/server/src/githook.rs b/server/src/githook.rs index f0e872a..24b4359 100644 --- a/server/src/githook.rs +++ b/server/src/githook.rs @@ -60,11 +60,8 @@ async fn main() -> Result<(), Box> { if data.len() == 3 { let mut commiter: Option = None; if pre && data[1] != git::EMPTY { - match repo.get_commiter(data[1]).await { - Ok(user) => { - commiter = Some(user.username); - } - Err(_) => {} + if let Ok(user) = repo.get_commiter(data[1]).await { + commiter = Some(user.username); } } @@ -72,7 +69,7 @@ async fn main() -> Result<(), Box> { old_value: data[0].to_string(), new_value: data[1].to_string(), reference: data[2].to_string(), - commiter: commiter, + commiter, }) } } -- cgit v1.2.3-70-g09d2