From ba82f1c50b93516d585658fa09bb18c2197f0b41 Mon Sep 17 00:00:00 2001 From: Brad Larsen Date: Thu, 17 Aug 2023 12:43:02 -0400 Subject: [PATCH] Fix clippy nits --- crates/noseyparker/src/blob_id_map.rs | 2 +- crates/noseyparker/src/datastore.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/noseyparker/src/blob_id_map.rs b/crates/noseyparker/src/blob_id_map.rs index 5cf287a74..fc55825ec 100644 --- a/crates/noseyparker/src/blob_id_map.rs +++ b/crates/noseyparker/src/blob_id_map.rs @@ -68,7 +68,7 @@ impl BlobIdMap { #[inline] pub fn get(&self, blob_id: &BlobId) -> Option { let bucket: u8 = blob_id.as_bytes()[0]; - self.maps[bucket as usize].lock().unwrap().get(&ObjectId::from(blob_id)).map(|v| *v) + self.maps[bucket as usize].lock().unwrap().get(&ObjectId::from(blob_id)).copied() } } diff --git a/crates/noseyparker/src/datastore.rs b/crates/noseyparker/src/datastore.rs index 852923cc9..dd4ed1db1 100644 --- a/crates/noseyparker/src/datastore.rs +++ b/crates/noseyparker/src/datastore.rs @@ -390,7 +390,7 @@ impl <'a> Transaction<'a> { let (provenance_id, kind) = match p { Provenance::File(e) => { let path = e.path.as_os_str().as_bytes(); - let payload_id = add_provenance_payload_file(&path)?; + let payload_id = add_provenance_payload_file(path)?; let provenance_id = add_provenance("file", payload_id)?; (provenance_id, None) } @@ -403,7 +403,7 @@ impl <'a> Transaction<'a> { (provenance_id, None) } Some(c) => { - let commit_id = add_git_commit(&c)?; + let commit_id = add_git_commit(c)?; let blob_path = c.blob_path.as_slice(); let payload_id = add_provenance_payload_git_commit(repo_path, commit_id, blob_path)?; let provenance_id = add_provenance("git_commit", payload_id)?;