Use SmartString inside ImmutableString.
This commit is contained in:
12
src/lib.rs
12
src/lib.rs
@@ -140,11 +140,11 @@ pub use utils::ImmutableString;
|
||||
|
||||
/// An identifier in Rhai. [`SmartString`](https://crates.io/crates/smartstring) is used because most
|
||||
/// identifiers are ASCII and short, fewer than 23 characters, so they can be stored inline.
|
||||
#[cfg(not(feature = "no_smartstring"))]
|
||||
pub type Identifier = smartstring::SmartString<smartstring::Compact>;
|
||||
#[cfg(not(feature = "no_smartstring_for_identifier"))]
|
||||
pub type Identifier = SmartString;
|
||||
|
||||
/// An identifier in Rhai.
|
||||
#[cfg(feature = "no_smartstring")]
|
||||
#[cfg(feature = "no_smartstring_for_identifier")]
|
||||
pub type Identifier = ImmutableString;
|
||||
|
||||
/// A trait to enable registering Rust functions.
|
||||
@@ -305,6 +305,12 @@ type StaticVec<T> = smallvec::SmallVec<[T; 4]>;
|
||||
#[cfg(feature = "internals")]
|
||||
pub type StaticVec<T> = smallvec::SmallVec<[T; 4]>;
|
||||
|
||||
#[cfg(not(feature = "internals"))]
|
||||
pub(crate) type SmartString = smartstring::SmartString<smartstring::Compact>;
|
||||
|
||||
#[cfg(feature = "internals")]
|
||||
pub type SmartString = smartstring::SmartString<smartstring::Compact>;
|
||||
|
||||
// Compiler guards against mutually-exclusive feature flags
|
||||
|
||||
#[cfg(feature = "no_float")]
|
||||
|
Reference in New Issue
Block a user