File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -16,4 +16,4 @@ publish = true
16
16
[dependencies ]
17
17
colored = " 2.0.0"
18
18
whoami = " 1.1.1"
19
- sysinfo = { version = " 0.16.5 " , default-features = false }
19
+ sysinfo = { version = " 0.23.2 " , default-features = false }
Original file line number Diff line number Diff line change 1
1
use colored:: * ;
2
2
use std:: string:: ToString ;
3
- use sysinfo:: { ProcessorExt , RefreshKind , System , SystemExt } ;
3
+ use sysinfo:: { System , SystemExt , RefreshKind , ProcessorExt } ;
4
4
5
5
const FERRIS_ART : & [ & str ] = & [
6
6
" " ,
@@ -66,11 +66,12 @@ fn main() {
66
66
art = false ;
67
67
}
68
68
69
- let sys = System :: new_with_specifics ( RefreshKind :: new ( ) . with_cpu ( ) . with_memory ( ) ) ;
70
- let cpu = sys. get_processors ( ) [ 0 ] . get_brand ( ) ;
71
- let kernel = sys. get_kernel_version ( ) . unwrap_or_else ( || "Unknown" . into ( ) ) ;
72
- let used_ram = sys. get_used_memory ( ) / 1024 ;
73
- let total_ram = sys. get_total_memory ( ) / 1024 ;
69
+ let mut sys = System :: new_with_specifics ( RefreshKind :: new ( ) . with_cpu ( ) ) ;
70
+ sys. refresh_all ( ) ;
71
+ let kernel = sys. kernel_version ( ) . unwrap_or_else ( || "Unknown" . into ( ) ) ;
72
+ let total_ram = sys. total_memory ( ) ;
73
+ let used_ram = sys. used_memory ( ) ;
74
+ let cpu = sys. processors ( ) [ 0 ] . brand ( ) ;
74
75
75
76
let rustc_ver = get_ver ( "rustc -V" ) ;
76
77
let cargo_ver = get_ver ( "cargo -V" ) ;
You can’t perform that action at this time.
0 commit comments