mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 14:00:31 +08:00
radicle: Mark AddressType as non_exhaustive
This commit is contained in:
committed by
Fintan Halpenny
parent
cff80006a2
commit
6d846d754d
@@ -2659,6 +2659,7 @@ where
|
||||
#[cfg(feature = "i2p")]
|
||||
AddressType::I2p => self.config.i2p != radicle::node::config::AddressConfig::Drop,
|
||||
AddressType::Dns | AddressType::Ipv4 | AddressType::Ipv6 => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -374,6 +374,12 @@ impl wire::Decode for Address {
|
||||
|
||||
HostName::I2p(i2p)
|
||||
}
|
||||
Ok(unknown) => {
|
||||
return Err(wire::Invalid::AddressType {
|
||||
actual: unknown.into(),
|
||||
}
|
||||
.into());
|
||||
}
|
||||
Err(other) => return Err(wire::Invalid::AddressType { actual: other }.into()),
|
||||
};
|
||||
let port = u16::decode(buf)?;
|
||||
|
||||
@@ -197,6 +197,7 @@ impl std::fmt::Display for Source {
|
||||
/// Address type.
|
||||
#[repr(u8)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[non_exhaustive]
|
||||
pub enum AddressType {
|
||||
Ipv4 = 1,
|
||||
Ipv6 = 2,
|
||||
|
||||
Reference in New Issue
Block a user