From 3abe7df3fbc12a8df259f48c746f2b9344a5f33c Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 3 Jun 2024 14:57:47 +0000 Subject: fix: bump rust and update accordingly --- crates/whirl_api/src/lib.rs | 8 +------- crates/whirl_api/src/routes/stats/mod.rs | 3 +-- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'crates/whirl_api') diff --git a/crates/whirl_api/src/lib.rs b/crates/whirl_api/src/lib.rs index efbec1a..9051f4c 100644 --- a/crates/whirl_api/src/lib.rs +++ b/crates/whirl_api/src/lib.rs @@ -3,13 +3,7 @@ //! The API, for external interaction. -#![feature( - type_ascription, - hash_set_entry, - type_name_of_val, - decl_macro, - proc_macro_hygiene -)] +#![feature(type_ascription, hash_set_entry, decl_macro, proc_macro_hygiene)] #![deny( warnings, nonstandard_style, diff --git a/crates/whirl_api/src/routes/stats/mod.rs b/crates/whirl_api/src/routes/stats/mod.rs index 595b441..05b9bc7 100644 --- a/crates/whirl_api/src/routes/stats/mod.rs +++ b/crates/whirl_api/src/routes/stats/mod.rs @@ -6,7 +6,6 @@ pub mod structures; use std::convert::TryFrom; use axum::response; -use num_traits::cast::AsPrimitive; use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use crate::routes::stats::structures::{Statistics, StatisticsProcess, StatisticsSystem}; @@ -31,7 +30,7 @@ pub async fn statistics() -> impl response::IntoResponse { process: StatisticsProcess { // (process.cpu_usage() * 100.0).round() / 100.0 memory_usage: (process.memory() / 1000).to_string(), - cpu_usage: (process.cpu_usage() / sys.processors().len().as_(): f32).to_string(), + cpu_usage: (process.cpu_usage() / sys.processors().len() as f32).to_string(), // uptime: seconds_to_hrtime((sys.get_uptime() - process.start_time()) as usize), }, }), -- cgit v1.2.3