Skip to content

Commit

Permalink
use const fns for name comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Aug 11, 2023
1 parent 6657207 commit 635fb14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/traits.rs
Expand Up @@ -48,7 +48,7 @@ impl<B> Flag<B> {
If [`name`] returns a non-empty string then this method will return `true`.
*/
pub const fn is_named(&self) -> bool {
self.name != ""
!self.name.is_empty()
}

/**
Expand All @@ -57,7 +57,7 @@ impl<B> Flag<B> {
If [`name`] returns a non-empty string then this method will return `false`.
*/
pub const fn is_unnamed(&self) -> bool {
self.name == ""
self.name.is_empty()
}
}

Expand Down

0 comments on commit 635fb14

Please sign in to comment.