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");