- let expected_label = exp_found.map_or("type".into(), |ef| ef.expected.prefix_string());
- let found_label = exp_found.map_or("type".into(), |ef| ef.found.prefix_string());
+ let expected_label = match exp_found {
+ Mismatch::Variable(ef) => ef.expected.prefix_string(),
+ Mismatch::Fixed(s) => s.into(),
+ };
+ let found_label = match exp_found {
+ Mismatch::Variable(ef) => ef.found.prefix_string(),
+ Mismatch::Fixed(s) => s.into(),
+ };
+ let exp_found = match exp_found {
+ Mismatch::Variable(exp_found) => Some(exp_found),
+ Mismatch::Fixed(_) => None,
+ };