diff options
Diffstat (limited to 'vendor/icu_locid/examples/filter_langids.rs')
-rw-r--r-- | vendor/icu_locid/examples/filter_langids.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/icu_locid/examples/filter_langids.rs b/vendor/icu_locid/examples/filter_langids.rs index 9e5b54e39..215df4eb3 100644 --- a/vendor/icu_locid/examples/filter_langids.rs +++ b/vendor/icu_locid/examples/filter_langids.rs @@ -16,6 +16,7 @@ icu_benchmark_macros::static_setup!(); use std::env; use icu_locid::{subtags, LanguageIdentifier}; +use writeable::Writeable; const DEFAULT_INPUT: &str = "de, en-us, zh-hant, sr-cyrl, fr-ca, es-cl, pl, en-latn-us, ca-valencia, und-arab"; @@ -30,7 +31,9 @@ fn filter_input(input: &str) -> String { let en_langids = langids.filter(|langid: &LanguageIdentifier| langid.language == en_lang); // 3. Serialize the output. - let en_strs: Vec<String> = en_langids.map(|langid| langid.to_string()).collect(); + let en_strs: Vec<String> = en_langids + .map(|langid| langid.write_to_string().into_owned()) + .collect(); en_strs.join(", ") } |