Skip to content

Commit

Permalink
Add must_use
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski committed Oct 15, 2023
1 parent 31e9589 commit 31718eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ pub fn parse_user_tag(s: &str) -> Option<(&str, Option<NonZeroU16>)> {
/// ```
///
/// [`User`]: crate::model::user::User
#[must_use]
pub fn parse_user_mention(mention: &str) -> Option<UserId> {
if mention.len() < 4 {
return None;
Expand Down Expand Up @@ -174,6 +175,7 @@ pub fn parse_username(mention: impl AsRef<str>) -> Option<UserId> {
/// ```
///
/// [`Role`]: crate::model::guild::Role
#[must_use]
pub fn parse_role_mention(mention: &str) -> Option<RoleId> {
if mention.len() < 4 {
return None;
Expand Down Expand Up @@ -217,6 +219,7 @@ pub fn parse_role(mention: impl AsRef<str>) -> Option<RoleId> {
/// ```
///
/// [`Channel`]: crate::model::channel::Channel
#[must_use]
pub fn parse_channel_mention(mention: &str) -> Option<ChannelId> {
if mention.len() < 4 {
return None;
Expand Down

0 comments on commit 31718eb

Please sign in to comment.