diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
commit | 2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch) | |
tree | d325add32978dbdc1db975a438b3a77d571b1ab8 /vendor/icu_locid/examples/filter_langids.rs | |
parent | Releasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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(", ") } |