Skip to content

Commit

Permalink
Add minimize_favor_script support to ICU4X 1.5 and 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Jan 8, 2025
1 parent 791918e commit d1283ea
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions executors/rust/src/likelysubtags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,20 @@ pub fn run_likelysubtags_test(json_obj: &Value) -> Result<Value, String> {
let mut locale = locale_str.parse::<LocaleType>().unwrap();

if test_option == &"minimizeFavorScript" {
// This option is not yet supported.
return Ok(json!({
"label": label,
"error_detail": {"option": test_option},
"unsupported": test_option,
"error_type": "unsupported",
}));
#[cfg(any(ver = "1.3", ver = "1.4"))]
{
// This option is not yet supported.
return Ok(json!({
"label": label,
"error_detail": {"option": test_option},
"unsupported": test_option,
"error_type": "unsupported",
}));
}
#[cfg(not(any(ver = "1.3", ver = "1.4")))]
{
lc.minimize_favor_script(&mut locale);
}
} else if test_option == &"minimize" || test_option == &"minimizeFavorRegion" {
lc.minimize(&mut locale);
} else if test_option == &"maximize" {
Expand Down

0 comments on commit d1283ea

Please sign in to comment.