From 7b14879d701ebf79f397a4d4829bd00b0a7b625e Mon Sep 17 00:00:00 2001 From: Knut Magnus Aasrud Date: Thu, 1 Jun 2023 11:35:18 +0200 Subject: [PATCH] style: simplify rel matching --- src/lib.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c4d8bd5..b8fa71d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -124,18 +124,12 @@ impl Link { /// Returns `true` if the link's `rel` is a URI. pub fn rel_is_uri(&self) -> bool { - match &self.rel { - RelOrUri::Rel(_) => false, - RelOrUri::Uri(_) => true, - } + matches!(self.rel, RelOrUri::Uri(_)) } /// Returns `true` if the link's `rel` is a registered relation type. pub fn rel_is_registered(&self) -> bool { - match &self.rel { - RelOrUri::Rel(_) => true, - RelOrUri::Uri(_) => false, - } + matches!(self.rel, RelOrUri::Rel(_)) } } -- 2.45.2