You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi !
Since version 0.20.0 I fail to build my tool because there is a mismatch between IpNetwork types :
λ ~/dev/fail(main*) » cargo run
Updating crates.io index
Compiling fail v0.1.0 (/home/mathieu/dev/fail)
error[E0308]: mismatched types
--> src/main.rs:8:17
|
7 | match ip {
| -- this expression has type `ipnetwork::IpNetwork`
8 | IpNetwork::V4(ipv4) => {
| ^^^^^^^^^^^^^^^^^^^ expected enum `ipnetwork::IpNetwork`, found enum `IpNetwork`
|
= note: perhaps two different versions of crate `ipnetwork` are being used?
error[E0308]: mismatched types
--> src/main.rs:11:17
|
7 | match ip {
| -- this expression has type `ipnetwork::IpNetwork`
...
11 | IpNetwork::V6(ipv6) => {
| ^^^^^^^^^^^^^^^^^^^ expected enum `ipnetwork::IpNetwork`, found enum `IpNetwork`
|
= note: perhaps two different versions of crate `ipnetwork` are being used?
For more information about this error, try `rustc --explain E0308`.
error: could not compile `fail` due to 2 previous errors
Here is the snippet I try to build bellow :
use ipnetwork::IpNetwork;use pnet_datalink;fnmain(){for iface in pnet_datalink::interfaces(){for ip in iface.ips{match ip {IpNetwork::V4(ipv4) => {println!("ipv4 : {}", ipv4.ip());}IpNetwork::V6(ipv6) => {println!("ipv6 : {}", ipv6.ip());}}}}}
It also uses pnet_datalink, but I only updated ipnetwork, that's why I suspect the issue to be related to this repo (I'm new to Rust so I may be wrong).
Any idea how I can fix this problem ?
Thanks.
The text was updated successfully, but these errors were encountered:
It also uses pnet_datalink, but I only update ipnetwork, that why I suspect the issue to be related to this repo
The issue is with the fact that you can't have types from a crate's version work with the same types from another version, even if type's structures are exactly equal. Make sure the versions match and it should all go back to working fine.
Hi !
Since version 0.20.0 I fail to build my tool because there is a mismatch between IpNetwork types :
Here is the snippet I try to build bellow :
It also uses pnet_datalink, but I only updated ipnetwork, that's why I suspect the issue to be related to this repo (I'm new to Rust so I may be wrong).
Any idea how I can fix this problem ?
Thanks.
The text was updated successfully, but these errors were encountered: