diff --git a/bitcoin/src/address/mod.rs b/bitcoin/src/address/mod.rs index c7053f667..cc948ad1e 100644 --- a/bitcoin/src/address/mod.rs +++ b/bitcoin/src/address/mod.rs @@ -383,6 +383,9 @@ impl Address { pub fn as_unchecked(&self) -> &Address { unsafe { &*(self as *const Address as *const Address) } } + + /// Marks the network of this address as unchecked. + pub fn into_unchecked(self) -> Address { Address(self.0, PhantomData) } } /// Methods and functions that can be called only on `Address`.