From fc64773b3894089c9e9bbc28a75af842d62aa8b4 Mon Sep 17 00:00:00 2001 From: Filip Filmar Date: Tue, 2 Mar 2021 12:36:45 -0800 Subject: [PATCH] fixup: handles the review comments --- rust_icu_ecma402/src/datetimeformat.rs | 1 + rust_icu_uloc/src/lib.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/rust_icu_ecma402/src/datetimeformat.rs b/rust_icu_ecma402/src/datetimeformat.rs index ab5f703a..6de554e2 100644 --- a/rust_icu_ecma402/src/datetimeformat.rs +++ b/rust_icu_ecma402/src/datetimeformat.rs @@ -33,6 +33,7 @@ pub(crate) mod internal { use rust_icu_ustring as ustring; use std::convert::TryFrom; + // TODO: implement this conversion completely. pub fn opt_to_pattern(_opts: DateTimeFormatOptions) -> Result { ustring::UChar::try_from("YYYY") } diff --git a/rust_icu_uloc/src/lib.rs b/rust_icu_uloc/src/lib.rs index b777e391..a851d313 100644 --- a/rust_icu_uloc/src/lib.rs +++ b/rust_icu_uloc/src/lib.rs @@ -940,4 +940,14 @@ mod tests { assert_eq!(ULoc::for_language_tag("en-t-it-u-tz-usnyc-nu-arabic-x-foo")?, loc); Ok(()) } + + #[test] + fn test_uloc_mut_add_unicode_extension() -> Result<(), Error> { + let loc = ULoc::for_language_tag("en-t-it-x-foo")?; + let mut loc_mut = ULocMut::from(loc); + loc_mut.set_unicode_keyvalue("tz", "usnyc"); + let loc = ULoc::from(loc_mut); + assert_eq!(ULoc::for_language_tag("en-t-it-u-tz-usnyc-x-foo")?, loc); + Ok(()) + } }