Make clippy happy

This commit is contained in:
Clément Renault 2025-01-08 16:16:21 +01:00
parent 0ee4671a91
commit 71e5605daa
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F
19 changed files with 55 additions and 59 deletions

View File

@ -106,7 +106,7 @@ impl IndexScheduler {
progress.update_progress(DumpCreationProgress::DumpTheIndexes); progress.update_progress(DumpCreationProgress::DumpTheIndexes);
let nb_indexes = self.index_mapper.index_mapping.len(&rtxn)? as u32; let nb_indexes = self.index_mapper.index_mapping.len(&rtxn)? as u32;
let mut count = 0; let mut count = 0;
self.index_mapper.try_for_each_index(&rtxn, |uid, index| -> Result<()> { let () = self.index_mapper.try_for_each_index(&rtxn, |uid, index| -> Result<()> {
progress.update_progress(VariableNameStep::new(uid.to_string(), count, nb_indexes)); progress.update_progress(VariableNameStep::new(uid.to_string(), count, nb_indexes));
count += 1; count += 1;

View File

@ -426,13 +426,8 @@ impl Segment {
&AuthFilter::default(), &AuthFilter::default(),
) { ) {
// Replace the version number with the prototype name if any. // Replace the version number with the prototype name if any.
let version = if let Some(prototype) = build_info::DescribeResult::from_build() let version = build_info::DescribeResult::from_build()
.and_then(|describe| describe.as_prototype()) .and_then(|describe| describe.as_prototype()).unwrap_or(env!("CARGO_PKG_VERSION"));
{
prototype
} else {
env!("CARGO_PKG_VERSION")
};
let _ = self let _ = self
.batcher .batcher

View File

@ -188,13 +188,13 @@ impl tracing_actix_web::RootSpanBuilder for AwebTracingLogger {
if let Some(error) = response.response().error() { if let Some(error) = response.response().error() {
// use the status code already constructed for the outgoing HTTP response // use the status code already constructed for the outgoing HTTP response
span.record("error", &tracing::field::display(error.as_response_error())); span.record("error", tracing::field::display(error.as_response_error()));
} }
} }
Err(error) => { Err(error) => {
let code: i32 = error.error_response().status().as_u16().into(); let code: i32 = error.error_response().status().as_u16().into();
span.record("status_code", code); span.record("status_code", code);
span.record("error", &tracing::field::display(error.as_response_error())); span.record("error", tracing::field::display(error.as_response_error()));
} }
}; };
} }

View File

@ -545,5 +545,5 @@ pub async fn get_health(
index_scheduler.health().unwrap(); index_scheduler.health().unwrap();
auth_controller.health().unwrap(); auth_controller.health().unwrap();
Ok(HttpResponse::Ok().json(&HealthResponse::default())) Ok(HttpResponse::Ok().json(HealthResponse::default()))
} }

View File

@ -73,8 +73,8 @@ async fn get_and_paginate_indexes() {
let server = Server::new().await; let server = Server::new().await;
const NB_INDEXES: usize = 50; const NB_INDEXES: usize = 50;
for i in 0..NB_INDEXES { for i in 0..NB_INDEXES {
server.index(&format!("test_{i:02}")).create(None).await; server.index(format!("test_{i:02}")).create(None).await;
server.index(&format!("test_{i:02}")).wait_task(i as u64).await; server.index(format!("test_{i:02}")).wait_task(i as u64).await;
} }
// basic // basic

View File

@ -24,6 +24,7 @@ For example, the DeadEndsCache could say the following:
- if we take `g`, then `[f]` is also forbidden - if we take `g`, then `[f]` is also forbidden
- etc. - etc.
- etc. - etc.
As we traverse the graph, we also traverse the `DeadEndsCache` and keep a list of forbidden As we traverse the graph, we also traverse the `DeadEndsCache` and keep a list of forbidden
conditions in memory. Then, we know to avoid all edges which have a condition that is forbidden. conditions in memory. Then, we know to avoid all edges which have a condition that is forbidden.

View File

@ -12,7 +12,6 @@ e.g. `sunflower` equivalent to `sun flower`.
4. The prefix databases can be used to find the sprximity between two words, but 4. The prefix databases can be used to find the sprximity between two words, but
they store fewer sprximities than the regular word sprximity DB. they store fewer sprximities than the regular word sprximity DB.
*/ */
use std::collections::BTreeMap; use std::collections::BTreeMap;

View File

@ -43,7 +43,8 @@ use crate::{CboRoaringBitmapCodec, Index, Result};
/// ///
/// - `ModificationResult::Nothing` means that modifying the `facet_value` didn't have any impact into the `level`. /// - `ModificationResult::Nothing` means that modifying the `facet_value` didn't have any impact into the `level`.
/// This case is reachable when a document id is removed from a sub-level node but is still present in another one. /// This case is reachable when a document id is removed from a sub-level node but is still present in another one.
/// For example, removing `2` from a document containing `2` and `3`, the document id will removed form the `level 0` but should remain in the group node [1..4] in `level 1`. /// For example, removing `2` from a document containing `2` and `3`, the document id will removed form the `level 0`
/// but should remain in the group node [1..4] in `level 1`.
enum ModificationResult { enum ModificationResult {
InPlace, InPlace,
Expand, Expand,