From 587b8f717153a87af5e9a074a2548822dfae8d63 Mon Sep 17 00:00:00 2001 From: Syfaro Date: Thu, 19 May 2022 12:38:01 -0400 Subject: [PATCH] Fix clippy lints. --- fuzzysearch-api/src/models.rs | 3 +-- fuzzysearch-refresh/src/main.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fuzzysearch-api/src/models.rs b/fuzzysearch-api/src/models.rs index adafed9..70ed1ad 100644 --- a/fuzzysearch-api/src/models.rs +++ b/fuzzysearch-api/src/models.rs @@ -182,8 +182,7 @@ pub async fn image_query( hash: row.hash, distance: row .distance - .map(|distance| u64::try_from(distance).ok()) - .flatten(), + .and_then(|distance| u64::try_from(distance).ok()), artists: row.artists, filename: row.filename.unwrap_or_default(), searched_hash: row.searched_hash, diff --git a/fuzzysearch-refresh/src/main.rs b/fuzzysearch-refresh/src/main.rs index eb02c3e..3b88f28 100644 --- a/fuzzysearch-refresh/src/main.rs +++ b/fuzzysearch-refresh/src/main.rs @@ -113,8 +113,7 @@ fn main() { .args() .iter() .next() - .map(|arg| arg.as_i64()) - .flatten() + .and_then(|arg| arg.as_i64()) .unwrap_or(1_000); tracing::debug!(batch_size, "calculating missing submissions");