From 363897043ff2b6dfcbbc3113fe79a3a92b1e569f Mon Sep 17 00:00:00 2001 From: Zokhoi <20432565+Zokhoi@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:35:47 +0800 Subject: [PATCH] Simplify expression --- src/tree/link.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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,