diff --git a/meilisearch-http/src/index_controller/index_actor/actor.rs b/meilisearch-http/src/index_controller/index_actor/actor.rs index 812cf8408..a4228227f 100644 --- a/meilisearch-http/src/index_controller/index_actor/actor.rs +++ b/meilisearch-http/src/index_controller/index_actor/actor.rs @@ -323,7 +323,7 @@ impl IndexActor { }) .await .map_err(|e| IndexError::Error(e.into()))? - .map_err(|e| IndexError::Error(e.into()))?; + .map_err(IndexError::Error)?; } Ok(()) diff --git a/meilisearch-http/src/index_controller/snapshot.rs b/meilisearch-http/src/index_controller/snapshot.rs index 669df6847..c433e3959 100644 --- a/meilisearch-http/src/index_controller/snapshot.rs +++ b/meilisearch-http/src/index_controller/snapshot.rs @@ -107,7 +107,7 @@ pub fn load_snapshot( db_path .as_ref() .canonicalize() - .unwrap_or(db_path.as_ref().to_owned()) + .unwrap_or_else(|_| db_path.as_ref().to_owned()) ) } else if !snapshot_path.as_ref().exists() && !ignore_missing_snapshot { bail!( @@ -115,7 +115,7 @@ pub fn load_snapshot( snapshot_path .as_ref() .canonicalize() - .unwrap_or(snapshot_path.as_ref().to_owned()) + .unwrap_or_else(|_| snapshot_path.as_ref().to_owned()) ) } else { Ok(())