fix: replace unwrap() with expect() in more files (#729 batch 13) (#3993)

This commit is contained in:
Zhengchao An
2026-06-28 11:45:13 +08:00
committed by GitHub
parent f0ab812213
commit 05d201679c
15 changed files with 126 additions and 126 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ pub fn set_global_guard(guard: OtelGuard) -> Result<(), GlobalError> {
///
/// # async fn trace_operation() -> Result<(), Box<dyn std::error::Error>> {
/// # let guard = get_global_guard()?;
/// # let _lock = guard.lock().unwrap();
/// # let _lock = guard.lock().expect("operation should succeed");
/// # // Perform traced operation
/// # Ok(())
/// # }
@@ -25,7 +25,7 @@
//! use rustfs_obs::metrics::collectors::{GpuCollector, collect_gpu_metrics};
//! use sysinfo::Pid;
//!
//! let pid = sysinfo::get_current_pid().unwrap();
//! let pid = sysinfo::get_current_pid().expect("operation should succeed");
//! let collector = GpuCollector::new(pid)?;
//! let stats = collector.collect()?;
//! let metrics = collect_gpu_metrics(&stats, &labels);
@@ -105,7 +105,7 @@ impl GpuCollector {
/// use rustfs_obs::metrics::collectors::GpuCollector;
/// use sysinfo::Pid;
///
/// let pid = sysinfo::get_current_pid().unwrap();
/// let pid = sysinfo::get_current_pid().expect("operation should succeed");
/// let collector = GpuCollector::new(pid)?;
/// ```
pub fn new(pid: Pid) -> Result<Self, GpuError> {