mirror of
https://github.com/NotAShelf/microfetch.git
synced 2025-12-08 14:03:51 +00:00
pass sysinfo to system.rs and uptime.rs (#6)
Some checks are pending
Rust / build (push) Waiting to run
Some checks are pending
Rust / build (push) Waiting to run
This commit is contained in:
parent
cd8ddc2177
commit
4d509839f5
3 changed files with 8 additions and 7 deletions
|
|
@ -1,9 +1,8 @@
|
|||
use color_eyre::Result;
|
||||
use nix::sys::sysinfo::sysinfo;
|
||||
use nix::sys::sysinfo::SysInfo;
|
||||
use std::io;
|
||||
|
||||
pub fn get_current() -> Result<String, io::Error> {
|
||||
let info = sysinfo().map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
|
||||
pub fn get_current(info: &SysInfo) -> Result<String, io::Error> {
|
||||
let uptime_seconds = info.uptime().as_secs_f64();
|
||||
|
||||
let total_minutes = (uptime_seconds / 60.0).round() as u64;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue