Skip to content

Commit 217b6ef

Browse files
authored
der: constify is_class fns (#1791)
1 parent c8c383c commit 217b6ef

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

der/src/tag.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -251,23 +251,23 @@ impl Tag {
251251
}
252252

253253
/// Is this an application tag?
254-
pub fn is_application(self) -> bool {
255-
self.class() == Class::Application
254+
pub const fn is_application(self) -> bool {
255+
matches!(self.class(), Class::Application)
256256
}
257257

258258
/// Is this a context-specific tag?
259-
pub fn is_context_specific(self) -> bool {
260-
self.class() == Class::ContextSpecific
259+
pub const fn is_context_specific(self) -> bool {
260+
matches!(self.class(), Class::ContextSpecific)
261261
}
262262

263263
/// Is this a private tag?
264-
pub fn is_private(self) -> bool {
265-
self.class() == Class::Private
264+
pub const fn is_private(self) -> bool {
265+
matches!(self.class(), Class::Private)
266266
}
267267

268268
/// Is this a universal tag?
269-
pub fn is_universal(self) -> bool {
270-
self.class() == Class::Universal
269+
pub const fn is_universal(self) -> bool {
270+
matches!(self.class(), Class::Universal)
271271
}
272272

273273
/// Create an [`Error`] for an invalid [`Length`].

0 commit comments

Comments
 (0)