Refine inlining.

This commit is contained in:
Stephen Chung
2021-03-04 18:13:47 +08:00
parent 4e69b1847d
commit 0589572d19
10 changed files with 23 additions and 24 deletions

View File

@@ -420,7 +420,7 @@ impl Hash for Dynamic {
}
/// Map the name of a standard type into a friendly form.
#[inline]
#[inline(always)]
pub(crate) fn map_std_type_name(name: &str) -> &str {
if name == type_name::<String>() {
"string"
@@ -1496,7 +1496,7 @@ impl Dynamic {
}
/// Convert the [`Dynamic`] into an [`ImmutableString`] and return it.
/// Returns the name of the actual type if the cast fails.
#[inline]
#[inline(always)]
pub fn take_immutable_string(self) -> Result<ImmutableString, &'static str> {
match self.0 {
Union::Str(s, _) => Ok(s),