【发布时间】:2021-07-14 09:39:56
【问题描述】:
我在枚举上有一个匹配块,其中一个匹配案例在同一个枚举上包含另一个匹配块。像这样的:
fn foo(&mut self, scenario: &mut Scenario) -> Result<&mut Self>
{
match self {
Scenario::Step { attributes, .. } => {
match scenario {
Scenario::Step { attributes,.. } => {
有什么方法可以访问内部匹配中的两个attributes 字段?我看到了从内部匹配块返回该字段的可能性,但是可以以更美观的方式处理它吗?
【问题讨论】: