From 71e8cf727d1530da4c9ad298079eb61883b119e9 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Mon, 20 Sep 2021 11:34:01 +0800 Subject: [PATCH] Use LazyCompact for SmartString. --- CHANGELOG.md | 4 ++++ src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6586b38f..daa864c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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>`. diff --git a/src/lib.rs b/src/lib.rs index dd704991..413af829 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -321,7 +321,7 @@ type StaticVec = smallvec::SmallVec<[T; 3]>; pub type StaticVec = smallvec::SmallVec<[T; 3]>; #[cfg(not(feature = "no_smartstring"))] -pub(crate) type SmartString = smartstring::SmartString; +pub(crate) type SmartString = smartstring::SmartString; #[cfg(feature = "no_smartstring")] pub(crate) type SmartString = String;