From 74557e352dba2de30848e4d91ae3e08927d823da Mon Sep 17 00:00:00 2001 From: Ville Lindholm Date: Mon, 2 Jun 2025 10:06:03 +0300 Subject: [PATCH] PR review 2 Signed-off-by: Ville Lindholm --- components/script/xpath/eval.rs | 5 +---- tests/wpt/tests/domxpath/fn-id.html | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/components/script/xpath/eval.rs b/components/script/xpath/eval.rs index 42791006bc2..4fd70ec1c97 100644 --- a/components/script/xpath/eval.rs +++ b/components/script/xpath/eval.rs @@ -95,10 +95,7 @@ where } fn is_primitive(&self) -> bool { - match self { - Some(expr) => expr.is_primitive(), - None => false, - } + self.as_ref().is_some_and(|t| T::is_primitive(t)) } } diff --git a/tests/wpt/tests/domxpath/fn-id.html b/tests/wpt/tests/domxpath/fn-id.html index 251de43024c..617ff7216d8 100644 --- a/tests/wpt/tests/domxpath/fn-id.html +++ b/tests/wpt/tests/domxpath/fn-id.html @@ -44,4 +44,4 @@ testIdFunction('id("")', '
Empty ID
', []); // Test whitespace in ID string testIdFunction('id(" test1 ")', '
Match
', ['test1']); - \ No newline at end of file +