Remove panics

This commit is contained in:
Mubelotix 2025-06-26 11:12:01 +02:00
parent 3fc16c627d
commit ef007d547d
No known key found for this signature in database
GPG key ID: 0406DF6C3A69B942
3 changed files with 14 additions and 11 deletions

View file

@ -100,7 +100,7 @@ pub struct EmbedderStatsView {
impl From<&EmbedderStats> for EmbedderStatsView {
fn from(stats: &EmbedderStats) -> Self {
let errors = stats.errors.read().unwrap();
let errors = stats.errors.read().unwrap_or_else(|p| p.into_inner());
Self {
total_count: stats.total_count.load(std::sync::atomic::Ordering::Relaxed),
error_count: errors.1 as usize,