Impl `From` for a reference type correctly
The previous implementation called `into` on a reference without dereferencing it. I thought the compiler would implicitly dereference, but it didn't, which lead to infinite recursion since the fn ended up calling itself.
This commit is contained in:
parent
8fca642d39
commit
3a66152d9e
|
@ -193,6 +193,6 @@ impl From<NetworkKind> for zcash_address::Network {
|
|||
|
||||
impl From<&NetworkKind> for zcash_address::Network {
|
||||
fn from(network: &NetworkKind) -> Self {
|
||||
network.into()
|
||||
(*network).into()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue