diff --git a/src/tree/link.rs b/src/tree/link.rs index 0738febf..c5da72b8 100644 --- a/src/tree/link.rs +++ b/src/tree/link.rs @@ -185,10 +185,7 @@ fn test_link_extra() { macro_rules! check { ($input:expr => $expected:expr) => {{ let actual = LinkLocation::parse_extra(cow!($input)); - let expected = match $expected { - None => None, - Some(extra) => Some(cow!(extra)), - }; + let expected = $expected.map(|s| cow!(s)); assert_eq!( actual, expected,