diff options
| -rw-r--r-- | server/src/git.rs | 4 | ||||
| -rw-r--r-- | server/src/githook.rs | 9 |
2 files changed, 5 insertions, 8 deletions
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<User, Error> { 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<User, Error> { 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<dyn Error>> { if data.len() == 3 { let mut commiter: Option<String> = 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<dyn Error>> { old_value: data[0].to_string(), new_value: data[1].to_string(), reference: data[2].to_string(), - commiter: commiter, + commiter, }) } } |
