Use more const functions.

This commit is contained in:
Stephen Chung
2021-11-27 14:24:06 +08:00
parent 280b5b405e
commit abe6b4a29b
7 changed files with 19 additions and 14 deletions

View File

@@ -539,7 +539,7 @@ impl ImmutableString {
/// Create a new [`ImmutableString`].
#[inline(always)]
pub fn new() -> Self {
Self(SmartString::new().into())
Self(SmartString::new_const().into())
}
/// Consume the [`ImmutableString`] and convert it into a [`String`].
/// If there are other references to the same string, a cloned copy is returned.