Macchina-CLI / libmacchina

A library providing access to all sorts of system information.
https://crates.io/crates/libmacchina
MIT License
68 stars 20 forks source link

fails to build on i686 #161

Closed Un1q32 closed 1 year ago

Un1q32 commented 1 year ago
   Compiling libmacchina v7.1.0 (/home/joey/Downloads/libmacchina)
error[E0308]: mismatched types
   --> src/shared/mod.rs:259:42
    |
259 |         let disk_size = stats.f_blocks * stats.f_bsize as UInt;
    |                                          ^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `u32`

error[E0277]: cannot multiply `u64` by `u32`
   --> src/shared/mod.rs:259:40
    |
259 |         let disk_size = stats.f_blocks * stats.f_bsize as UInt;
    |                                        ^ no implementation for `u64 * u32`
    |
    = help: the trait `Mul<u32>` is not implemented for `u64`
    = help: the following other types implement trait `Mul<Rhs>`:
              <&'a u64 as Mul<u64>>
              <&u64 as Mul<&u64>>
              <u64 as Mul<&u64>>
              <u64 as Mul>

error[E0308]: mismatched types
   --> src/shared/mod.rs:262:37
    |
262 |         let used_byte = disk_size - free;
    |                                     ^^^^ expected `u64`, found `u32`

error[E0277]: cannot subtract `u32` from `u64`
   --> src/shared/mod.rs:262:35
    |
262 |         let used_byte = disk_size - free;
    |                                   ^ no implementation for `u64 - u32`
    |
    = help: the trait `Sub<u32>` is not implemented for `u64`
    = help: the following other types implement trait `Sub<Rhs>`:
              <&'a u64 as Sub<u64>>
              <&u64 as Sub<&u64>>
              <u64 as Sub<&u64>>
              <u64 as Sub>

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `libmacchina` due to 4 previous errors
Gobidev commented 1 year ago

This was pretty simple to fix, I made a PR: #162

grtcdr commented 1 year ago

Thanks for taking care of this :)