Skip to content

Commit da3583a

Browse files
committed
refactor: simplify uptime retrieval in Report::new method
1 parent 5f0fa34 commit da3583a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/analytics.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ pub struct Report {
9595
impl Report {
9696
pub async fn new() -> anyhow::Result<Self> {
9797
let mut upt: f64 = 0.0;
98-
if let Ok(uptime) = uptime_lib::get() {
99-
upt = uptime.as_secs_f64();
100-
}
98+
let uptime = uptime_lib::get().unwrap();
99+
upt = uptime.as_secs_f64();
101100

102101
refresh_sys_info();
103102
let mut os_version = "Unknown".to_string();

0 commit comments

Comments
 (0)