Рассмотрим следующий пример:
pub enum DigitalWallet {
WithMemo {
currency: String,
address: String,
tag: String,
},
WithoutMemo {
currency: String,
address: String,
},
}
impl<'a> DigitalWallet {
fn getCurrency(self: &'a Self) -> &'a String {
match self {
DigitalWallet::WithMemo {
currency: String, ..
} => currency,
DigitalWallet::WithoutMemo {
currency: String, ..
} => currency,
}
}
}
Почему это приводит к следующему?
error[E0425]: cannot find value `currency` in this scope
--> src/lib.rs:18:18
|
18 | } => currency,
| ^^^^^^^^ not found in this scope
error[E0425]: cannot find value `currency` in this scope
--> src/lib.rs:21:18
|
21 | } => currency,
| ^^^^^^^^ not found in this scope