Use LazyCompact for SmartString.

This commit is contained in:
Stephen Chung 2021-09-20 11:34:01 +08:00
parent 2d46bf37c8
commit 71e8cf727d
2 changed files with 5 additions and 1 deletions

View File

@ -37,6 +37,10 @@ Enhancements
* Added `log10()` for `Decimal`.
* `ln` for `Decimal` is now checked and won't panic.
### String Values
* `SmartString` now uses `LazyCompact` instead of `Compact` to minimize allocations.
### `Scope` API
* `Scope::set_value` now takes anything that implements `Into<Cow<str>>`.

View File

@ -321,7 +321,7 @@ type StaticVec<T> = smallvec::SmallVec<[T; 3]>;
pub type StaticVec<T> = smallvec::SmallVec<[T; 3]>;
#[cfg(not(feature = "no_smartstring"))]
pub(crate) type SmartString = smartstring::SmartString<smartstring::Compact>;
pub(crate) type SmartString = smartstring::SmartString<smartstring::LazyCompact>;
#[cfg(feature = "no_smartstring")]
pub(crate) type SmartString = String;