mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Remove panics
This commit is contained in:
parent
3fc16c627d
commit
ef007d547d
3 changed files with 14 additions and 11 deletions
|
@ -30,7 +30,9 @@ pub struct EmbedderStats {
|
|||
|
||||
impl std::fmt::Debug for EmbedderStats {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let (error, count) = self.errors.read().unwrap().clone();
|
||||
let guard = self.errors.read().unwrap_or_else(|p| p.into_inner());
|
||||
let (error, count) = (guard.0.clone(), guard.1);
|
||||
std::mem::drop(guard);
|
||||
f.debug_struct("EmbedderStats")
|
||||
.field("last_error", &error)
|
||||
.field("total_count", &self.total_count.load(Ordering::Relaxed))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue