mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-27 16:07:46 +00:00
Add must_use to StrExt methods
This commit is contained in:
parent
79bb5e39b5
commit
da4eb11ce9
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user