Make FnPtr::fn_name_raw const.

This commit is contained in:
Stephen Chung
2021-06-29 21:47:27 +08:00
parent 0346bb874b
commit d146de4ff9
4 changed files with 18 additions and 5 deletions

View File

@@ -106,12 +106,25 @@ impl From<String> for ImmutableString {
}
}
#[cfg(not(feature = "no_smartstring"))]
impl From<&SmartString> for ImmutableString {
#[inline(always)]
fn from(value: &SmartString) -> Self {
Self(Into::<SmartString>::into(value.as_str()).into())
}
}
#[cfg(not(feature = "no_smartstring"))]
impl From<SmartString> for ImmutableString {
#[inline(always)]
fn from(value: SmartString) -> Self {
Self(value.into())
}
}
impl From<&ImmutableString> for SmartString {
#[inline(always)]
fn from(value: &ImmutableString) -> Self {
value.as_str().into()
}
}
impl From<ImmutableString> for SmartString {
#[inline(always)]
fn from(mut value: ImmutableString) -> Self {