From 9d6986c4b21e20c33acc4bdad10f66598ed91d27 Mon Sep 17 00:00:00 2001 From: dishmaker <141624503+dishmaker@users.noreply.github.com> Date: Fri, 2 May 2025 14:16:01 +0200 Subject: [PATCH] der: constify is_class fns --- der/src/tag.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/der/src/tag.rs b/der/src/tag.rs index ce374a319..03d6f90fb 100644 --- a/der/src/tag.rs +++ b/der/src/tag.rs @@ -251,23 +251,23 @@ impl Tag { } /// Is this an application tag? - pub fn is_application(self) -> bool { - self.class() == Class::Application + pub const fn is_application(self) -> bool { + matches!(self.class(), Class::Application) } /// Is this a context-specific tag? - pub fn is_context_specific(self) -> bool { - self.class() == Class::ContextSpecific + pub const fn is_context_specific(self) -> bool { + matches!(self.class(), Class::ContextSpecific) } /// Is this a private tag? - pub fn is_private(self) -> bool { - self.class() == Class::Private + pub const fn is_private(self) -> bool { + matches!(self.class(), Class::Private) } /// Is this a universal tag? - pub fn is_universal(self) -> bool { - self.class() == Class::Universal + pub const fn is_universal(self) -> bool { + matches!(self.class(), Class::Universal) } /// Create an [`Error`] for an invalid [`Length`].