Skip to content

Commit

Permalink
fixup: handles the review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
filmil committed Mar 2, 2021
1 parent 8632748 commit fc64773
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions rust_icu_ecma402/src/datetimeformat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, common::Error> {
ustring::UChar::try_from("YYYY")
}
Expand Down
10 changes: 10 additions & 0 deletions rust_icu_uloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
}

0 comments on commit fc64773

Please sign in to comment.