From dbfd150bb65ef9b681ee5dbbd1b2a3cc2ba96490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Sat, 20 Jan 2024 16:37:19 +1300 Subject: [PATCH] Clippy --- crates/bosion/src/info.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/bosion/src/info.rs b/crates/bosion/src/info.rs index 2e867edc..ff83a061 100644 --- a/crates/bosion/src/info.rs +++ b/crates/bosion/src/info.rs @@ -257,7 +257,7 @@ mod git { } pub fn read_commit(repo: &Path, hash: &oid) -> Result, String> { - if let Some(path) = object_file(&repo, &hash) { + if let Some(path) = object_file(repo, hash) { let mut file = File::open(path).err_string()?; let size = file.metadata().err_string()?.len() as usize; @@ -269,7 +269,7 @@ mod git { flate.once(&raw, &mut buf).err_string()?; Ok(buf) } else { - let (pack_path, offset) = find_in_index(&repo, &hash)?.ok_or_else(|| { + let (pack_path, offset) = find_in_index(repo, hash)?.ok_or_else(|| { String::from("HEAD is a packed ref, but can't find it in git pack") })?; @@ -286,8 +286,7 @@ mod git { .ok_or_else(|| String::from("HEAD has no committer"))?; let date_s = &commit[committer_line_offset..] .split(|b| *b == b' ') - .skip(3) - .next() + .nth(3) .ok_or_else(|| String::from("malformed committer in commit")) .and_then(|s| std::str::from_utf8(s).err_string()) .and_then(|s| i64::from_str(s).err_string())?;