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:
Marek 2024-04-26 14:21:47 +02:00
parent 8fca642d39
commit 3a66152d9e
1 changed files with 1 additions and 1 deletions

View File

@ -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()
}
}