From b14ef8424a5fb5634297cdb407a9340192e631b3 Mon Sep 17 00:00:00 2001 From: "Shane F. Carr" Date: Thu, 24 Jun 2021 01:42:50 -0500 Subject: [PATCH] Migrate HelloWorldV1 and DecimalSymbolsV1 to `serde(borrow)` --- Cargo.lock | 1 - components/decimal/Cargo.toml | 1 - components/decimal/src/format.rs | 10 ++--- components/decimal/src/provider.rs | 40 +++++++++++-------- experimental/provider_static/README.md | 7 ++++ experimental/provider_static/src/lib.rs | 9 +++-- .../cldr/src/transform/numbers/cldr_serde.rs | 10 ++--- .../src/transform/numbers/decimal_pattern.rs | 31 +++++--------- provider/cldr/src/transform/numbers/mod.rs | 6 +-- provider/core/src/hello_world.rs | 2 +- provider/core/tests/data_receiver.rs | 6 +-- .../data/json/decimal/symbols@1/ar-EG.json | 4 +- .../data/json/decimal/symbols@1/ar.json | 4 +- .../data/json/decimal/symbols@1/bn.json | 4 +- .../data/json/decimal/symbols@1/ccp.json | 4 +- .../data/json/decimal/symbols@1/en-001.json | 4 +- .../data/json/decimal/symbols@1/en-ZA.json | 4 +- .../data/json/decimal/symbols@1/en.json | 4 +- .../data/json/decimal/symbols@1/es-AR.json | 4 +- .../data/json/decimal/symbols@1/es.json | 4 +- .../data/json/decimal/symbols@1/fr.json | 4 +- .../data/json/decimal/symbols@1/ja.json | 4 +- .../data/json/decimal/symbols@1/ru.json | 4 +- .../data/json/decimal/symbols@1/sr-Cyrl.json | 4 +- .../data/json/decimal/symbols@1/sr-Latn.json | 4 +- .../data/json/decimal/symbols@1/sr.json | 4 +- .../data/json/decimal/symbols@1/th.json | 4 +- .../data/json/decimal/symbols@1/tr.json | 4 +- .../data/json/decimal/symbols@1/und.json | 4 +- 29 files changed, 93 insertions(+), 102 deletions(-) create mode 100644 experimental/provider_static/README.md diff --git a/Cargo.lock b/Cargo.lock index c6ceee3442e..a4689a38c30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -917,7 +917,6 @@ dependencies = [ "rand_distr", "rand_pcg", "serde", - "smallstr", "thiserror", "writeable", ] diff --git a/components/decimal/Cargo.toml b/components/decimal/Cargo.toml index 5dec9051919..904f318e4f6 100644 --- a/components/decimal/Cargo.toml +++ b/components/decimal/Cargo.toml @@ -28,7 +28,6 @@ skip_optional_dependencies = true all-features = true [dependencies] -smallstr = { version = "0.2", features = ["serde"] } icu_locid = { version = "0.2", path = "../locid" } icu_provider = { version = "0.2", path = "../../provider/core" } fixed_decimal = { version = "0.2", path = "../../utils/fixed_decimal" } diff --git a/components/decimal/src/format.rs b/components/decimal/src/format.rs index 2e33c318710..826da251ea3 100644 --- a/components/decimal/src/format.rs +++ b/components/decimal/src/format.rs @@ -17,7 +17,7 @@ use writeable::Writeable; pub struct FormattedFixedDecimal<'l> { pub(crate) value: &'l FixedDecimal, pub(crate) options: &'l FixedDecimalFormatOptions, - pub(crate) symbols: &'l DecimalSymbolsV1, + pub(crate) symbols: &'l DecimalSymbolsV1<'l>, } impl<'l> FormattedFixedDecimal<'l> { @@ -38,9 +38,7 @@ impl<'l> Writeable for FormattedFixedDecimal<'l> { { let affixes = self.get_affixes(); if let Some(affixes) = affixes { - if let Some(prefix) = &affixes.prefix { - sink.write_str(prefix)?; - } + sink.write_str(&affixes.prefix)?; } let range = self.value.magnitude_range(); let upper_magnitude = *range.end(); @@ -60,9 +58,7 @@ impl<'l> Writeable for FormattedFixedDecimal<'l> { } } if let Some(affixes) = affixes { - if let Some(suffix) = &affixes.suffix { - sink.write_str(suffix)?; - } + sink.write_str(&affixes.suffix)?; } Ok(()) } diff --git a/components/decimal/src/provider.rs b/components/decimal/src/provider.rs index 0000dd1958b..405614ad03a 100644 --- a/components/decimal/src/provider.rs +++ b/components/decimal/src/provider.rs @@ -6,7 +6,7 @@ //! //! Read more about data providers: [`icu_provider`] -pub type SmallString8 = smallstr::SmallString<[u8; 8]>; +use std::borrow::Cow; pub mod key { //! Resource keys for [`icu_decimal`](crate). @@ -22,12 +22,14 @@ pub mod key { feature = "provider_serde", derive(serde::Serialize, serde::Deserialize) )] -pub struct AffixesV1 { +pub struct AffixesV1<'s> { /// String to prepend before the decimal number. - pub prefix: Option, + #[cfg_attr(feature = "provider_serde", serde(borrow))] + pub prefix: Cow<'s, str>, /// String to append after the decimal number. - pub suffix: Option, + #[cfg_attr(feature = "provider_serde", serde(borrow))] + pub suffix: Cow<'s, str>, } /// A collection of settings expressing where to put grouping separators in a decimal number. @@ -55,18 +57,21 @@ pub struct GroupingSizesV1 { feature = "provider_serde", derive(serde::Serialize, serde::Deserialize) )] -pub struct DecimalSymbolsV1 { +pub struct DecimalSymbolsV1<'s> { /// Prefix and suffix to apply when a negative sign is needed. - pub minus_sign_affixes: AffixesV1, + #[cfg_attr(feature = "provider_serde", serde(borrow))] + pub minus_sign_affixes: AffixesV1<'s>, /// Prefix and suffix to apply when a plus sign is needed. - pub plus_sign_affixes: AffixesV1, + #[cfg_attr(feature = "provider_serde", serde(borrow))] + pub plus_sign_affixes: AffixesV1<'s>, /// Character used to separate the integer and fraction parts of the number. - pub decimal_separator: SmallString8, + #[cfg_attr(feature = "provider_serde", serde(borrow))] + pub decimal_separator: Cow<'s, str>, /// Character used to separate groups in the integer part of the number. - pub grouping_separator: SmallString8, + pub grouping_separator: Cow<'s, str>, /// Settings used to determine where to place groups in the integer part of the number. pub grouping_sizes: GroupingSizesV1, @@ -76,16 +81,16 @@ pub struct DecimalSymbolsV1 { pub digits: [char; 10], } -impl Default for DecimalSymbolsV1 { +impl Default for DecimalSymbolsV1<'static> { fn default() -> Self { Self { minus_sign_affixes: AffixesV1 { - prefix: Some("-".into()), - suffix: None, + prefix: Cow::Borrowed("-"), + suffix: Cow::Borrowed(""), }, plus_sign_affixes: AffixesV1 { - prefix: Some("+".into()), - suffix: None, + prefix: Cow::Borrowed("+"), + suffix: Cow::Borrowed(""), }, decimal_separator: ".".into(), grouping_separator: ",".into(), @@ -99,8 +104,9 @@ impl Default for DecimalSymbolsV1 { } } -icu_provider::impl_data_marker_no_lifetime!( - DecimalSymbolsV1, +icu_provider::unsafe_impl_data_marker_with_lifetime!( + DecimalSymbolsV1<'s>, /// Marker type for [`DecimalSymbolsV1`] - DecimalSymbolsV1Marker + DecimalSymbolsV1Marker, + TEMP_ZCF ); diff --git a/experimental/provider_static/README.md b/experimental/provider_static/README.md new file mode 100644 index 00000000000..2c368ed153d --- /dev/null +++ b/experimental/provider_static/README.md @@ -0,0 +1,7 @@ +# icu_provider_static [![crates.io](http://meritbadge.herokuapp.com/icu_provider_static)](https://crates.io/crates/icu_provider_static) + + + +## More Information + +For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x). diff --git a/experimental/provider_static/src/lib.rs b/experimental/provider_static/src/lib.rs index 1bd1395b0e9..3a08db2d23d 100644 --- a/experimental/provider_static/src/lib.rs +++ b/experimental/provider_static/src/lib.rs @@ -26,7 +26,7 @@ impl StaticDataProvider { } } - fn get_file(&self, req: &DataRequest) -> Result<&&str, DataError> { + fn get_file(&self, req: &DataRequest) -> Result<&'static str, DataError> { let key_components = req.resource_path.key.get_components(); let opt_components = req.resource_path.options.get_components(); let key: Vec<&str> = key_components.iter().chain(opt_components.iter()).collect(); @@ -34,6 +34,7 @@ impl StaticDataProvider { self.json .get(&*key) .ok_or(DataError::UnsupportedResourceKey(req.resource_path.key)) + .map(|v| *v) } } @@ -46,13 +47,13 @@ impl Default for StaticDataProvider { impl<'d, 's, M> DataProvider<'d, 's, M> for StaticDataProvider where M: DataMarker<'s>, - // TODO(#667): Use zero-copy Deserialize instead of DeserializeOwned - M::Yokeable: serde::de::DeserializeOwned, + // 'static is what we want here, because we are deserializing from a static buffer. + M::Yokeable: serde::de::Deserialize<'static>, { fn load_payload(&self, req: &DataRequest) -> Result, DataError> { let file = self.get_file(req)?; let data: M::Yokeable = - M::Yokeable::deserialize(&mut serde_json::Deserializer::from_reader(file.as_bytes())) + M::Yokeable::deserialize(&mut serde_json::Deserializer::from_slice(file.as_bytes())) .map_err(|e| DataError::Resource(Box::new(e)))?; Ok(DataResponse { metadata: DataResponseMetadata { diff --git a/provider/cldr/src/transform/numbers/cldr_serde.rs b/provider/cldr/src/transform/numbers/cldr_serde.rs index 7cdb61e45a0..0daad4ea9a5 100644 --- a/provider/cldr/src/transform/numbers/cldr_serde.rs +++ b/provider/cldr/src/transform/numbers/cldr_serde.rs @@ -9,8 +9,6 @@ use serde_aux::prelude::*; use std::collections::HashMap; use tinystr::{TinyStr8, TinyStrAuto}; -pub type SmallString8 = smallstr::SmallString<[u8; 8]>; - pub mod numbers_json { //! Serde structs representing CLDR JSON numbers.json files. //! @@ -24,12 +22,12 @@ pub mod numbers_json { #[derive(PartialEq, Debug, Deserialize)] pub struct Symbols { // This list is not comprehensive; add more fields when needed - pub decimal: SmallString8, - pub group: SmallString8, + pub decimal: String, + pub group: String, #[serde(rename = "minusSign")] - pub minus_sign: SmallString8, + pub minus_sign: String, #[serde(rename = "plusSign")] - pub plus_sign: SmallString8, + pub plus_sign: String, } #[derive(PartialEq, Debug, Deserialize)] diff --git a/provider/cldr/src/transform/numbers/decimal_pattern.rs b/provider/cldr/src/transform/numbers/decimal_pattern.rs index 4c32bd50c0c..f97de183300 100644 --- a/provider/cldr/src/transform/numbers/decimal_pattern.rs +++ b/provider/cldr/src/transform/numbers/decimal_pattern.rs @@ -6,10 +6,10 @@ //! //! Spec reference: https://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns -use std::str::FromStr; -type SmallString8 = smallstr::SmallString<[u8; 8]>; use icu_decimal::provider::AffixesV1; use itertools::Itertools; +use std::borrow::Cow; +use std::str::FromStr; use thiserror::Error; #[derive(Error, Debug, PartialEq)] @@ -23,8 +23,8 @@ pub enum Error { /// Representation of a UTS-35 number subpattern (part of a number pattern between ';'s). #[derive(Debug, PartialEq)] pub struct DecimalSubPattern { - pub prefix: SmallString8, - pub suffix: SmallString8, + pub prefix: String, + pub suffix: String, pub primary_grouping: u8, pub secondary_grouping: u8, pub min_fraction_digits: u8, @@ -98,29 +98,16 @@ impl FromStr for DecimalPattern { } impl DecimalPattern { - pub fn localize_sign(&self, sign_str: &str) -> AffixesV1 { + pub fn localize_sign(&self, sign_str: &str) -> AffixesV1<'static> { // UTS 35: the absence of a negative pattern means a single prefixed sign let signed_affixes = self .negative .as_ref() - .map(|subpattern| { - ( - if subpattern.prefix.is_empty() { - None - } else { - Some(subpattern.prefix.clone()) - }, - if subpattern.suffix.is_empty() { - None - } else { - Some(subpattern.suffix.clone()) - }, - ) - }) - .unwrap_or_else(|| (Some("-".into()), None)); + .map(|subpattern| (subpattern.prefix.as_str(), subpattern.suffix.as_str())) + .unwrap_or_else(|| ("-", "")); AffixesV1 { - prefix: signed_affixes.0.map(|s| s.replace("-", sign_str).into()), - suffix: signed_affixes.1.map(|s| s.replace("-", sign_str).into()), + prefix: Cow::Owned(signed_affixes.0.replace("-", sign_str)), + suffix: Cow::Owned(signed_affixes.1.replace("-", sign_str)), } } } diff --git a/provider/cldr/src/transform/numbers/mod.rs b/provider/cldr/src/transform/numbers/mod.rs index b392c463ed5..03753717ead 100644 --- a/provider/cldr/src/transform/numbers/mod.rs +++ b/provider/cldr/src/transform/numbers/mod.rs @@ -160,7 +160,7 @@ impl<'d> IterableDataProviderCore for NumbersProvider { } } -impl TryFrom<&cldr_serde::numbers_json::Numbers> for DecimalSymbolsV1 { +impl TryFrom<&cldr_serde::numbers_json::Numbers> for DecimalSymbolsV1<'static> { type Error = Cow<'static, str>; fn try_from(other: &cldr_serde::numbers_json::Numbers) -> Result { @@ -183,8 +183,8 @@ impl TryFrom<&cldr_serde::numbers_json::Numbers> for DecimalSymbolsV1 { Ok(Self { minus_sign_affixes: parsed_pattern.localize_sign(&symbols.minus_sign), plus_sign_affixes: parsed_pattern.localize_sign(&symbols.plus_sign), - decimal_separator: symbols.decimal.clone(), - grouping_separator: symbols.group.clone(), + decimal_separator: Cow::Owned(symbols.decimal.clone()), + grouping_separator: Cow::Owned(symbols.group.clone()), grouping_sizes: GroupingSizesV1 { primary: parsed_pattern.positive.primary_grouping, secondary: parsed_pattern.positive.secondary_grouping, diff --git a/provider/core/src/hello_world.rs b/provider/core/src/hello_world.rs index 497180e821f..ef0be61fe18 100644 --- a/provider/core/src/hello_world.rs +++ b/provider/core/src/hello_world.rs @@ -26,7 +26,7 @@ pub mod key { derive(serde::Serialize, serde::Deserialize) )] pub struct HelloWorldV1<'s> { - // TODO(#667): Use serde borrow. + #[cfg_attr(feature = "provider_serde", serde(borrow))] pub message: Cow<'s, str>, } diff --git a/provider/core/tests/data_receiver.rs b/provider/core/tests/data_receiver.rs index 18be22de1d9..cc3aebf0253 100644 --- a/provider/core/tests/data_receiver.rs +++ b/provider/core/tests/data_receiver.rs @@ -26,8 +26,7 @@ fn test_deserializer_static() { assert!(matches!( payload.get(), &HelloWorldV1 { - // TODO(#667): This should be Borrowed once HelloWorldV1 supports it - message: Cow::Owned(_) + message: Cow::Borrowed(_) } )); } @@ -48,8 +47,7 @@ fn test_deserializer_owned() { assert!(matches!( payload.get(), &HelloWorldV1 { - // TODO(#667): This should be Borrowed once HelloWorldV1 supports it - message: Cow::Owned(_) + message: Cow::Borrowed(_) } )); } diff --git a/provider/testdata/data/json/decimal/symbols@1/ar-EG.json b/provider/testdata/data/json/decimal/symbols@1/ar-EG.json index 46ac4e87863..ad30f81da83 100644 --- a/provider/testdata/data/json/decimal/symbols@1/ar-EG.json +++ b/provider/testdata/data/json/decimal/symbols@1/ar-EG.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "؜-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "؜+", - "suffix": null + "suffix": "" }, "decimal_separator": "٫", "grouping_separator": "٬", diff --git a/provider/testdata/data/json/decimal/symbols@1/ar.json b/provider/testdata/data/json/decimal/symbols@1/ar.json index 46ac4e87863..ad30f81da83 100644 --- a/provider/testdata/data/json/decimal/symbols@1/ar.json +++ b/provider/testdata/data/json/decimal/symbols@1/ar.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "؜-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "؜+", - "suffix": null + "suffix": "" }, "decimal_separator": "٫", "grouping_separator": "٬", diff --git a/provider/testdata/data/json/decimal/symbols@1/bn.json b/provider/testdata/data/json/decimal/symbols@1/bn.json index b99f55c4485..453c93a7481 100644 --- a/provider/testdata/data/json/decimal/symbols@1/bn.json +++ b/provider/testdata/data/json/decimal/symbols@1/bn.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ".", "grouping_separator": ",", diff --git a/provider/testdata/data/json/decimal/symbols@1/ccp.json b/provider/testdata/data/json/decimal/symbols@1/ccp.json index 9ad5216c5c6..0ee6c07a1bb 100644 --- a/provider/testdata/data/json/decimal/symbols@1/ccp.json +++ b/provider/testdata/data/json/decimal/symbols@1/ccp.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ".", "grouping_separator": ",", diff --git a/provider/testdata/data/json/decimal/symbols@1/en-001.json b/provider/testdata/data/json/decimal/symbols@1/en-001.json index d4db64adc27..b10589e19e5 100644 --- a/provider/testdata/data/json/decimal/symbols@1/en-001.json +++ b/provider/testdata/data/json/decimal/symbols@1/en-001.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ".", "grouping_separator": ",", diff --git a/provider/testdata/data/json/decimal/symbols@1/en-ZA.json b/provider/testdata/data/json/decimal/symbols@1/en-ZA.json index 8bbeccb55f1..2962fe22987 100644 --- a/provider/testdata/data/json/decimal/symbols@1/en-ZA.json +++ b/provider/testdata/data/json/decimal/symbols@1/en-ZA.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ",", "grouping_separator": " ", diff --git a/provider/testdata/data/json/decimal/symbols@1/en.json b/provider/testdata/data/json/decimal/symbols@1/en.json index d4db64adc27..b10589e19e5 100644 --- a/provider/testdata/data/json/decimal/symbols@1/en.json +++ b/provider/testdata/data/json/decimal/symbols@1/en.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ".", "grouping_separator": ",", diff --git a/provider/testdata/data/json/decimal/symbols@1/es-AR.json b/provider/testdata/data/json/decimal/symbols@1/es-AR.json index 04b9143e0c5..a722d954889 100644 --- a/provider/testdata/data/json/decimal/symbols@1/es-AR.json +++ b/provider/testdata/data/json/decimal/symbols@1/es-AR.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ",", "grouping_separator": ".", diff --git a/provider/testdata/data/json/decimal/symbols@1/es.json b/provider/testdata/data/json/decimal/symbols@1/es.json index b5cdf451bb0..5d636e26aef 100644 --- a/provider/testdata/data/json/decimal/symbols@1/es.json +++ b/provider/testdata/data/json/decimal/symbols@1/es.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ",", "grouping_separator": ".", diff --git a/provider/testdata/data/json/decimal/symbols@1/fr.json b/provider/testdata/data/json/decimal/symbols@1/fr.json index 1811a2ad8fb..f7a34260a09 100644 --- a/provider/testdata/data/json/decimal/symbols@1/fr.json +++ b/provider/testdata/data/json/decimal/symbols@1/fr.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ",", "grouping_separator": " ", diff --git a/provider/testdata/data/json/decimal/symbols@1/ja.json b/provider/testdata/data/json/decimal/symbols@1/ja.json index d4db64adc27..b10589e19e5 100644 --- a/provider/testdata/data/json/decimal/symbols@1/ja.json +++ b/provider/testdata/data/json/decimal/symbols@1/ja.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ".", "grouping_separator": ",", diff --git a/provider/testdata/data/json/decimal/symbols@1/ru.json b/provider/testdata/data/json/decimal/symbols@1/ru.json index 8bbeccb55f1..2962fe22987 100644 --- a/provider/testdata/data/json/decimal/symbols@1/ru.json +++ b/provider/testdata/data/json/decimal/symbols@1/ru.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ",", "grouping_separator": " ", diff --git a/provider/testdata/data/json/decimal/symbols@1/sr-Cyrl.json b/provider/testdata/data/json/decimal/symbols@1/sr-Cyrl.json index 04b9143e0c5..a722d954889 100644 --- a/provider/testdata/data/json/decimal/symbols@1/sr-Cyrl.json +++ b/provider/testdata/data/json/decimal/symbols@1/sr-Cyrl.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ",", "grouping_separator": ".", diff --git a/provider/testdata/data/json/decimal/symbols@1/sr-Latn.json b/provider/testdata/data/json/decimal/symbols@1/sr-Latn.json index 04b9143e0c5..a722d954889 100644 --- a/provider/testdata/data/json/decimal/symbols@1/sr-Latn.json +++ b/provider/testdata/data/json/decimal/symbols@1/sr-Latn.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ",", "grouping_separator": ".", diff --git a/provider/testdata/data/json/decimal/symbols@1/sr.json b/provider/testdata/data/json/decimal/symbols@1/sr.json index 04b9143e0c5..a722d954889 100644 --- a/provider/testdata/data/json/decimal/symbols@1/sr.json +++ b/provider/testdata/data/json/decimal/symbols@1/sr.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ",", "grouping_separator": ".", diff --git a/provider/testdata/data/json/decimal/symbols@1/th.json b/provider/testdata/data/json/decimal/symbols@1/th.json index d4db64adc27..b10589e19e5 100644 --- a/provider/testdata/data/json/decimal/symbols@1/th.json +++ b/provider/testdata/data/json/decimal/symbols@1/th.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ".", "grouping_separator": ",", diff --git a/provider/testdata/data/json/decimal/symbols@1/tr.json b/provider/testdata/data/json/decimal/symbols@1/tr.json index 04b9143e0c5..a722d954889 100644 --- a/provider/testdata/data/json/decimal/symbols@1/tr.json +++ b/provider/testdata/data/json/decimal/symbols@1/tr.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ",", "grouping_separator": ".", diff --git a/provider/testdata/data/json/decimal/symbols@1/und.json b/provider/testdata/data/json/decimal/symbols@1/und.json index d4db64adc27..b10589e19e5 100644 --- a/provider/testdata/data/json/decimal/symbols@1/und.json +++ b/provider/testdata/data/json/decimal/symbols@1/und.json @@ -1,11 +1,11 @@ { "minus_sign_affixes": { "prefix": "-", - "suffix": null + "suffix": "" }, "plus_sign_affixes": { "prefix": "+", - "suffix": null + "suffix": "" }, "decimal_separator": ".", "grouping_separator": ",",