mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-15 15:50:38 +08:00
Since `tor` and `i2p` are features, dependents may compile the `radicle` crate without these features and will not be able to parse `AddressType`. Allow parsing of the `AddressType` to fail, and skip if that is the case. Further, the same holds for `Address`, and skip if that fails to parse as well. Finally, `Address` may parse an address string successfully to `HostName`, but it may have an `AddressType` that does not match the `HostName` variant. Guard against this, again skipping if they are not equal. For example, `HostName::Dns` is a `String` underneath, so there is higher chance that something like `deadbeef.onion` parses to this variant.