heim-rs / heim

Cross-platform async library for system information fetching 🦀
https://heim-rs.github.io/
Apache License 2.0
902 stars 95 forks source link

error when compiling heim-net under Ubuntu 18.04 and 20.04 #361

Open leontiad opened 2 years ago

leontiad commented 2 years ago

It seems that there is an error in a dependency to heim when trying to compile heim-net, complaining for a not implemented Error train coming from testdir crate:

 Compiling heim-net v0.1.0-beta.2
   Compiling tofnd v0.9.1 (/home/tofnd)
error[E0277]: `?` couldn't convert the error to `heim_common::Error`
  --> /home/.cargo/registry/src/github.com-1ecc6299db9ec823/heim-net-0.1.0-beta.2/src/sys/unix/nic.rs:66:37
   |
66 |     let iter = ifaddrs::getifaddrs()?.filter_map(|addr| {
   |                                     ^ the trait `From<nix::Error>` is not implemented for `heim_common::Error`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = help: the following implementations were found:
             <heim_common::Error as From<Infallible>>
             <heim_common::Error as From<NulError>>
             <heim_common::Error as From<ParseFloatError>>
             <heim_common::Error as From<ParseIntError>>
           and 2 others
   = note: required because of the requirements on the impl of `FromResidual<std::result::Result<Infallible, nix::Error>>` for `std::result::Result<_, heim_common::Error>`

For more information about this error, try `rustc --explain E0277`.