Skip to content

Commit

Permalink
Add must_use to StrExt methods
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic authored and Veykril committed Feb 8, 2024
1 parent fe7064e commit 0078fdf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,24 +551,28 @@ pub trait StrExt: private::Sealed {
/// potentially without allocating.
///
/// See [`str::to_lowercase`].
#[must_use = "this returns a new SmolStr without modifying the original"]
fn to_lowercase_smolstr(&self) -> SmolStr;

/// Returns the uppercase equivalent of this string slice as a new [`SmolStr`],
/// potentially without allocating.
///
/// See [`str::to_uppercase`].
#[must_use = "this returns a new SmolStr without modifying the original"]
fn to_uppercase_smolstr(&self) -> SmolStr;

/// Returns the ASCII lowercase equivalent of this string slice as a new [`SmolStr`],
/// potentially without allocating.
///
/// See [`str::to_ascii_lowercase`].
#[must_use = "this returns a new SmolStr without modifying the original"]
fn to_ascii_lowercase_smolstr(&self) -> SmolStr;

/// Returns the ASCII uppercase equivalent of this string slice as a new [`SmolStr`],
/// potentially without allocating.
///
/// See [`str::to_ascii_uppercase`].
#[must_use = "this returns a new SmolStr without modifying the original"]
fn to_ascii_uppercase_smolstr(&self) -> SmolStr;
}

Expand Down

0 comments on commit 0078fdf

Please sign in to comment.