valpackett / systemstat

Rust library for getting system information | also on https://codeberg.org/valpackett/systemstat
https://crates.io/crates/systemstat
The Unlicense
610 stars 71 forks source link

Fails on i386: error[E0308]: mismatched types #114

Closed yurivict closed 1 year ago

yurivict commented 1 year ago
error[E0308]: mismatched types
   --> /wrkdirs/usr/ports/shells/starship/work/starship-1.11.0/cargo-crates/systemstat-0.2.1/src/platform/freebsd.rs:114:54
    |
114 | ...   let ts = OffsetDateTime::from_unix_timestamp(data.tv_sec).expect("unix timestamp should be within range") + Duration::from_nanos(da...
    |                ----------------------------------- ^^^^^^^^^^^ expected `i64`, found `i32`
    |                |
    |                arguments to this function are incorrect
    |
note: associated function defined here
   --> /wrkdirs/usr/ports/shells/starship/work/starship-1.11.0/cargo-crates/time-0.3.14/src/offset_date_time.rs:208:18
    |
208 |     pub const fn from_unix_timestamp(timestamp: i64) -> Result<Self, error::ComponentRange> {
    |                  ^^^^^^^^^^^^^^^^^^^
help: you can convert an `i32` to an `i64`
    |
114 |         let ts = OffsetDateTime::from_unix_timestamp(data.tv_sec.into()).expect("unix timestamp should be within range") + Duration::from_nanos(data.tv_usec as u64);
    |                                                        
$ rustc --version --verbose
rustc 1.63.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-freebsd
release: 1.63.0
LLVM version: 14.0.5
valpackett commented 1 year ago

Oops, looks like some #107 fallout. (ugh the time library situation in rust >_<) Uploaded 0.2.2.