From c0bcfaf6dbab627fd9ac87b5f32ae966cb19bf75 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Tue, 12 Nov 2024 16:25:58 -0800 Subject: [PATCH] ffi --- ffi/capi/src/decimal.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffi/capi/src/decimal.rs b/ffi/capi/src/decimal.rs index a0294bb1561..87e5cc4fd85 100644 --- a/ffi/capi/src/decimal.rs +++ b/ffi/capi/src/decimal.rs @@ -73,6 +73,7 @@ pub mod ffi { grouping_strategy: Option, ) -> Result, DataError> { use alloc::borrow::Cow; + use zerovec::VarZeroCow; fn str_to_cow(s: &diplomat_runtime::DiplomatStr) -> Cow<'static, str> { if s.is_empty() { Cow::default() @@ -102,7 +103,6 @@ pub mod ffi { decimal_separator: str_to_cow(decimal_separator), grouping_separator: str_to_cow(grouping_separator), }; - let strings = zerovec::ule::encode_varule_to_box(&strings); let grouping_sizes = GroupingSizesV1 { primary: primary_group_size, @@ -117,7 +117,7 @@ pub mod ffi { Ok(Box::new(FixedDecimalFormatter( icu_decimal::FixedDecimalFormatter::try_new_unstable( &icu_provider_adapters::fixed::FixedProvider::from_owned(DecimalSymbolsV1 { - strings: Cow::Owned(strings), + strings: VarZeroCow::from_encodeable(&strings), grouping_sizes, digits, }),