From f5ec035ada8ff6b12d035521d84d0236cc3419fd Mon Sep 17 00:00:00 2001 From: Robert Bastian <4706271+robertbastian@users.noreply.github.com> Date: Tue, 3 Oct 2023 18:41:55 +0200 Subject: [PATCH 1/5] 132 --- Cargo.lock | 100 ++++++------- Cargo.toml | 105 +++++++------- .../codepointtrie_builder/Cargo.toml | 2 +- components/datetime/Cargo.toml | 2 +- components/locid_transform/Cargo.toml | 2 +- components/segmenter/Cargo.toml | 2 +- experimental/compactdecimal/Cargo.toml | 2 +- experimental/displaynames/Cargo.toml | 2 +- experimental/relativetime/Cargo.toml | 2 +- experimental/transliterate/Cargo.toml | 2 +- experimental/unicodeset_parse/Cargo.toml | 2 +- experimental/zerotrie/Cargo.toml | 2 +- ffi/diplomat/Cargo.toml | 2 +- .../icu_capi_staticlib_tiny/Cargo.lock | 135 +++++++++++------- ffi/diplomat/src/locale_directionality.rs | 1 + ffi/freertos/Cargo.toml | 2 +- provider/datagen/Cargo.toml | 2 +- provider/datagen/src/transform/cldr/source.rs | 3 +- provider/fs/Cargo.toml | 2 +- provider/testdata/Cargo.toml | 4 +- utils/tinystr/Cargo.toml | 2 +- 21 files changed, 202 insertions(+), 176 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 770e2ef0d8b..238e843a269 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1167,7 +1167,7 @@ checksum = "71a816c97c42258aa5834d07590b718b4c9a598944cd39a52dc25b351185d678" [[package]] name = "icu" -version = "1.3.0" +version = "1.3.2" dependencies = [ "icu_calendar", "icu_casemap", @@ -1226,7 +1226,7 @@ dependencies = [ [[package]] name = "icu_calendar" -version = "1.3.0" +version = "1.3.2" dependencies = [ "calendrical_calculations", "criterion", @@ -1247,11 +1247,11 @@ dependencies = [ [[package]] name = "icu_calendar_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_capi" -version = "1.3.0" +version = "1.3.2" dependencies = [ "diplomat", "diplomat-runtime", @@ -1285,7 +1285,7 @@ dependencies = [ [[package]] name = "icu_capi_cdylib" -version = "1.3.0" +version = "1.3.2" dependencies = [ "icu_capi", "icu_provider", @@ -1293,7 +1293,7 @@ dependencies = [ [[package]] name = "icu_capi_staticlib" -version = "1.3.0" +version = "1.3.2" dependencies = [ "icu_capi", "icu_provider", @@ -1301,7 +1301,7 @@ dependencies = [ [[package]] name = "icu_casemap" -version = "1.3.0" +version = "1.3.2" dependencies = [ "criterion", "databake", @@ -1321,11 +1321,11 @@ dependencies = [ [[package]] name = "icu_casemap_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_codepointtrie_builder" -version = "0.3.5" +version = "0.3.6" dependencies = [ "icu", "icu_collections", @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "icu_collator" -version = "1.3.0" +version = "1.3.2" dependencies = [ "arraystring", "atoi", @@ -1362,11 +1362,11 @@ dependencies = [ [[package]] name = "icu_collator_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_collections" -version = "1.3.0" +version = "1.3.2" dependencies = [ "criterion", "databake", @@ -1386,7 +1386,7 @@ dependencies = [ [[package]] name = "icu_compactdecimal" -version = "0.2.1" +version = "0.2.2" dependencies = [ "databake", "displaydoc", @@ -1404,11 +1404,11 @@ dependencies = [ [[package]] name = "icu_compactdecimal_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_datagen" -version = "1.3.0" +version = "1.3.2" dependencies = [ "clap 4.2.1", "crlify", @@ -1464,7 +1464,7 @@ dependencies = [ [[package]] name = "icu_datetime" -version = "1.3.0" +version = "1.3.2" dependencies = [ "bincode", "criterion", @@ -1495,11 +1495,11 @@ dependencies = [ [[package]] name = "icu_datetime_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_decimal" -version = "1.3.0" +version = "1.3.2" dependencies = [ "criterion", "databake", @@ -1522,7 +1522,7 @@ dependencies = [ [[package]] name = "icu_decimal_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_depcheck" @@ -1530,7 +1530,7 @@ version = "0.1.0" [[package]] name = "icu_displaynames" -version = "0.11.0" +version = "0.11.1" dependencies = [ "databake", "icu_displaynames_data", @@ -1544,7 +1544,7 @@ dependencies = [ [[package]] name = "icu_displaynames_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_ffi_coverage" @@ -1560,7 +1560,7 @@ dependencies = [ [[package]] name = "icu_freertos" -version = "1.3.0" +version = "1.3.2" dependencies = [ "cortex-m", "freertos-rust", @@ -1583,7 +1583,7 @@ dependencies = [ [[package]] name = "icu_list" -version = "1.3.0" +version = "1.3.2" dependencies = [ "databake", "deduplicating_array", @@ -1602,11 +1602,11 @@ dependencies = [ [[package]] name = "icu_list_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_locid" -version = "1.3.0" +version = "1.3.2" dependencies = [ "criterion", "databake", @@ -1625,7 +1625,7 @@ dependencies = [ [[package]] name = "icu_locid_transform" -version = "1.3.0" +version = "1.3.2" dependencies = [ "criterion", "databake", @@ -1643,11 +1643,11 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_normalizer" -version = "1.3.0" +version = "1.3.2" dependencies = [ "arraystring", "arrayvec", @@ -1670,7 +1670,7 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_pattern" @@ -1695,7 +1695,7 @@ dependencies = [ [[package]] name = "icu_plurals" -version = "1.3.0" +version = "1.3.2" dependencies = [ "criterion", "databake", @@ -1714,11 +1714,11 @@ dependencies = [ [[package]] name = "icu_plurals_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_properties" -version = "1.3.0" +version = "1.3.2" dependencies = [ "databake", "displaydoc", @@ -1735,11 +1735,11 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_provider" -version = "1.3.0" +version = "1.3.2" dependencies = [ "bincode", "databake", @@ -1763,7 +1763,7 @@ dependencies = [ [[package]] name = "icu_provider_adapters" -version = "1.3.0" +version = "1.3.2" dependencies = [ "databake", "icu_locid", @@ -1779,7 +1779,7 @@ dependencies = [ [[package]] name = "icu_provider_blob" -version = "1.3.0" +version = "1.3.2" dependencies = [ "icu_datagen", "icu_locid", @@ -1793,7 +1793,7 @@ dependencies = [ [[package]] name = "icu_provider_fs" -version = "1.3.0" +version = "1.3.2" dependencies = [ "bincode", "criterion", @@ -1813,7 +1813,7 @@ dependencies = [ [[package]] name = "icu_provider_macros" -version = "1.3.0" +version = "1.3.2" dependencies = [ "icu_provider", "proc-macro2", @@ -1823,7 +1823,7 @@ dependencies = [ [[package]] name = "icu_relativetime" -version = "0.1.2" +version = "0.1.3" dependencies = [ "databake", "displaydoc", @@ -1841,11 +1841,11 @@ dependencies = [ [[package]] name = "icu_relativetime_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_segmenter" -version = "1.3.0" +version = "1.3.2" dependencies = [ "core_maths", "criterion", @@ -1866,7 +1866,7 @@ dependencies = [ [[package]] name = "icu_segmenter_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_singlenumberformatter" @@ -1883,7 +1883,7 @@ dependencies = [ [[package]] name = "icu_singlenumberformatter_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_testdata_scripts" @@ -1905,7 +1905,7 @@ dependencies = [ [[package]] name = "icu_timezone" -version = "1.3.0" +version = "1.3.2" dependencies = [ "databake", "displaydoc", @@ -1922,11 +1922,11 @@ dependencies = [ [[package]] name = "icu_timezone_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_transliterate" -version = "0.1.0" +version = "0.1.1" dependencies = [ "criterion", "databake", @@ -1945,7 +1945,7 @@ dependencies = [ [[package]] name = "icu_unicodeset_parse" -version = "0.1.0" +version = "0.1.1" dependencies = [ "icu_collections", "icu_properties", @@ -1970,7 +1970,7 @@ dependencies = [ [[package]] name = "icu_unitsconversion_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "ident_case" @@ -3262,7 +3262,7 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.3" +version = "0.7.4" dependencies = [ "bincode", "criterion", @@ -4152,7 +4152,7 @@ dependencies = [ [[package]] name = "zerotrie" -version = "0.1.0" +version = "0.1.1" dependencies = [ "bincode", "criterion", diff --git a/Cargo.toml b/Cargo.toml index b8f272a773a..17ff89091ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -114,7 +114,7 @@ exclude = [ ] [workspace.package] -version = "1.3.0" +version = "1.3.2" rust-version = "1.66" authors = ["The ICU4X Project Developers"] edition = "2021" @@ -137,64 +137,64 @@ include = [ # KEEP IN SYNC WITH workspace.members and docs/tutorials/testing/patch.toml # Components -icu = { version = "~1.3.0", path = "components/icu", default-features = false } -icu_calendar = { version = "~1.3.0", path = "components/calendar", default-features = false } -icu_casemap = { version = "~1.3.0", path = "components/casemap", default-features = false } -icu_collator = { version = "~1.3.0", path = "components/collator", default-features = false } -icu_collections = { version = "~1.3.0", path = "components/collections", default-features = false } -icu_codepointtrie_builder = { version = "0.3.5", path = "components/collections/codepointtrie_builder", default-features = false } -icu_datetime = { version = "~1.3.0", path = "components/datetime", default-features = false } -icu_decimal = { version = "~1.3.0", path = "components/decimal", default-features = false } -icu_list = { version = "~1.3.0", path = "components/list", default-features = false } -icu_locid = { version = "~1.3.0", path = "components/locid", default-features = false } -icu_locid_transform = { version = "~1.3.0", path = "components/locid_transform", default-features = false } -icu_normalizer = { version = "~1.3.0", path = "components/normalizer", default-features = false } -icu_plurals = { version = "~1.3.0", path = "components/plurals", default-features = false } -icu_properties = { version = "~1.3.0", path = "components/properties", default-features = false } -icu_segmenter = { version = "~1.3.0", path = "components/segmenter", default-features = false } -icu_timezone = { version = "~1.3.0", path = "components/timezone", default-features = false } -icu_compactdecimal = { version = "0.2.1", path = "experimental/compactdecimal", default-features = false } -icu_displaynames = { version = "0.11.0", path = "experimental/displaynames", default-features = false } +icu = { version = "~1.3.2", path = "components/icu", default-features = false } +icu_calendar = { version = "~1.3.2", path = "components/calendar", default-features = false } +icu_casemap = { version = "~1.3.2", path = "components/casemap", default-features = false } +icu_collator = { version = "~1.3.2", path = "components/collator", default-features = false } +icu_collections = { version = "~1.3.2", path = "components/collections", default-features = false } +icu_codepointtrie_builder = { version = "0.3.6", path = "components/collections/codepointtrie_builder", default-features = false } +icu_datetime = { version = "~1.3.2", path = "components/datetime", default-features = false } +icu_decimal = { version = "~1.3.2", path = "components/decimal", default-features = false } +icu_list = { version = "~1.3.2", path = "components/list", default-features = false } +icu_locid = { version = "~1.3.2", path = "components/locid", default-features = false } +icu_locid_transform = { version = "~1.3.2", path = "components/locid_transform", default-features = false } +icu_normalizer = { version = "~1.3.2", path = "components/normalizer", default-features = false } +icu_plurals = { version = "~1.3.2", path = "components/plurals", default-features = false } +icu_properties = { version = "~1.3.2", path = "components/properties", default-features = false } +icu_segmenter = { version = "~1.3.2", path = "components/segmenter", default-features = false } +icu_timezone = { version = "~1.3.2", path = "components/timezone", default-features = false } +icu_compactdecimal = { version = "0.2.2", path = "experimental/compactdecimal", default-features = false } +icu_displaynames = { version = "0.11.1", path = "experimental/displaynames", default-features = false } icu_personnames = { version = "0.0.0", path = "experimental/personnames", default-features = false } -icu_relativetime = { version = "0.1.2", path = "experimental/relativetime", default-features = false } +icu_relativetime = { version = "0.1.3", path = "experimental/relativetime", default-features = false } icu_singlenumberformatter = { version = "0.0.0", path = "experimental/single_number_formatter", default-features = false } -icu_transliterate = { version = "0.1.0", path = "experimental/transliterate", default-features = false } -icu_unicodeset_parse = { version = "0.1.0", path = "experimental/unicodeset_parse", default-features = false } +icu_transliterate = { version = "0.1.1", path = "experimental/transliterate", default-features = false } +icu_unicodeset_parse = { version = "0.1.1", path = "experimental/unicodeset_parse", default-features = false } icu_unitsconversion = { version = "0.0.0", path = "experimental/unitsconversion", default-features = false } # Components data -icu_calendar_data = { version = "~1.3.0", path = "components/calendar/data", default-features = false } -icu_casemap_data = { version = "~1.3.0", path = "components/casemap/data", default-features = false } -icu_collator_data = { version = "~1.3.0", path = "components/collator/data", default-features = false } -icu_datetime_data = { version = "~1.3.0", path = "components/datetime/data", default-features = false } -icu_decimal_data = { version = "~1.3.0", path = "components/decimal/data", default-features = false } -icu_list_data = { version = "~1.3.0", path = "components/list/data", default-features = false } -icu_locid_transform_data = { version = "~1.3.0", path = "components/locid_transform/data", default-features = false } -icu_normalizer_data = { version = "~1.3.0", path = "components/normalizer/data", default-features = false } -icu_plurals_data = { version = "~1.3.0", path = "components/plurals/data", default-features = false } -icu_properties_data = { version = "~1.3.0", path = "components/properties/data", default-features = false } -icu_segmenter_data = { version = "~1.3.0", path = "components/segmenter/data", default-features = false } -icu_timezone_data = { version = "~1.3.0", path = "components/timezone/data", default-features = false } -icu_compactdecimal_data = { version = "~1.3.0", path = "experimental/compactdecimal/data", default-features = false } -icu_displaynames_data = { version = "~1.3.0", path = "experimental/displaynames/data", default-features = false } -icu_relativetime_data = { version = "~1.3.0", path = "experimental/relativetime/data", default-features = false } -icu_singlenumberformatter_data = { version = "~1.3.0", path = "experimental/single_number_formatter/data", default-features = false } +icu_calendar_data = { version = "~1.3.2", path = "components/calendar/data", default-features = false } +icu_casemap_data = { version = "~1.3.2", path = "components/casemap/data", default-features = false } +icu_collator_data = { version = "~1.3.2", path = "components/collator/data", default-features = false } +icu_datetime_data = { version = "~1.3.2", path = "components/datetime/data", default-features = false } +icu_decimal_data = { version = "~1.3.2", path = "components/decimal/data", default-features = false } +icu_list_data = { version = "~1.3.2", path = "components/list/data", default-features = false } +icu_locid_transform_data = { version = "~1.3.2", path = "components/locid_transform/data", default-features = false } +icu_normalizer_data = { version = "~1.3.2", path = "components/normalizer/data", default-features = false } +icu_plurals_data = { version = "~1.3.2", path = "components/plurals/data", default-features = false } +icu_properties_data = { version = "~1.3.2", path = "components/properties/data", default-features = false } +icu_segmenter_data = { version = "~1.3.2", path = "components/segmenter/data", default-features = false } +icu_timezone_data = { version = "~1.3.2", path = "components/timezone/data", default-features = false } +icu_compactdecimal_data = { version = "~1.3.2", path = "experimental/compactdecimal/data", default-features = false } +icu_displaynames_data = { version = "~1.3.2", path = "experimental/displaynames/data", default-features = false } +icu_relativetime_data = { version = "~1.3.2", path = "experimental/relativetime/data", default-features = false } +icu_singlenumberformatter_data = { version = "~1.3.2", path = "experimental/single_number_formatter/data", default-features = false } # FFI -icu_capi = { version = "~1.3.0", path = "ffi/diplomat", default-features = false } -icu_capi_cdylib = { version = "~1.3.0", path = "ffi/capi_cdylib", default-features = false } -icu_capi_staticlib = { version = "~1.3.0", path = "ffi/capi_staticlib", default-features = false } +icu_capi = { version = "~1.3.2", path = "ffi/diplomat", default-features = false } +icu_capi_cdylib = { version = "~1.3.2", path = "ffi/capi_cdylib", default-features = false } +icu_capi_staticlib = { version = "~1.3.2", path = "ffi/capi_staticlib", default-features = false } icu4x_ecma402 = { version = "0.8.0", path = "ffi/ecma402", default-features = false } -icu_freertos = { version = "~1.3.0", path = "ffi/freertos", default-features = false } -icu_harfbuzz = { version = "~1.3.0", path = "experimental/harfbuzz", default-features = false } +icu_freertos = { version = "~1.3.2", path = "ffi/freertos", default-features = false } +icu_harfbuzz = { version = "~1.3.2", path = "experimental/harfbuzz", default-features = false } # Provider -icu_datagen = { version = "~1.3.0", path = "provider/datagen", default-features = false } -icu_provider = { version = "~1.3.0", path = "provider/core", default-features = false } -icu_provider_adapters = { version = "~1.3.0", path = "provider/adapters", default-features = false } -icu_provider_blob = { version = "~1.3.0", path = "provider/blob", default-features = false } -icu_provider_fs = { version = "~1.3.0", path = "provider/fs/", default-features = false } -icu_provider_macros = { version = "~1.3.0", path = "provider/macros", default-features = false } +icu_datagen = { version = "~1.3.2", path = "provider/datagen", default-features = false } +icu_provider = { version = "~1.3.2", path = "provider/core", default-features = false } +icu_provider_adapters = { version = "~1.3.2", path = "provider/adapters", default-features = false } +icu_provider_blob = { version = "~1.3.2", path = "provider/blob", default-features = false } +icu_provider_fs = { version = "~1.3.2", path = "provider/fs/", default-features = false } +icu_provider_macros = { version = "~1.3.2", path = "provider/macros", default-features = false } # Utils calendrical_calculations = { version = "0.1.0", path = "utils/calendrical_calculations", default-features = false } @@ -212,12 +212,11 @@ yoke = { version = "0.7.2", path = "utils/yoke", default-features = false } yoke-derive = { version = "0.7.2", path = "utils/yoke/derive", default-features = false } zerofrom = { version = "0.1.2", path = "utils/zerofrom", default-features = false } zerofrom-derive = { version = "0.1.2", path = "utils/zerofrom/derive", default-features = false } -# Remove this range bound next ICU4X version -zerovec = { version = ">=0.9.4, <0.11.0", path = "utils/zerovec", default-features = false } -zerovec-derive = { version = ">=0.9.4, <0.11.0", path = "utils/zerovec/derive", default-features = false } +zerovec = { version = "0.10.0", path = "utils/zerovec", default-features = false } +zerovec-derive = { version = "0.10.0", path = "utils/zerovec/derive", default-features = false } bies = { version = "0.2.2", path = "experimental/bies", default-features = false } ixdtf = { version = "0.1.1", path = "experimental/ixdtf", default-features = false } -zerotrie = { version = "0.1.0", path = "experimental/zerotrie", default-features = false } +zerotrie = { version = "0.1.1", path = "experimental/zerotrie", default-features = false } # Tools icu_benchmark_macros = { path = "tools/benchmark/macros" } diff --git a/components/collections/codepointtrie_builder/Cargo.toml b/components/collections/codepointtrie_builder/Cargo.toml index b873bf73639..f44ee0f13a5 100644 --- a/components/collections/codepointtrie_builder/Cargo.toml +++ b/components/collections/codepointtrie_builder/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "icu_codepointtrie_builder" description = "Runtime builder for CodePointTrie" -version = "0.3.5" +version = "0.3.6" license-file = "LICENSE" include = [ "src/**/*", diff --git a/components/datetime/Cargo.toml b/components/datetime/Cargo.toml index 4d8ca76c670..9a1b76953e6 100644 --- a/components/datetime/Cargo.toml +++ b/components/datetime/Cargo.toml @@ -5,7 +5,6 @@ [package] name = "icu_datetime" description = "API for formatting date and time to user readable textual representation" -version = "1.3.0" license-file = "LICENSE" authors.workspace = true @@ -15,6 +14,7 @@ homepage.workspace = true include.workspace = true repository.workspace = true rust-version.workspace = true +version.workspace = true [package.metadata.docs.rs] all-features = true diff --git a/components/locid_transform/Cargo.toml b/components/locid_transform/Cargo.toml index 55df8550f4e..9ab430ea4f1 100644 --- a/components/locid_transform/Cargo.toml +++ b/components/locid_transform/Cargo.toml @@ -5,7 +5,6 @@ [package] name = "icu_locid_transform" description = "API for Unicode Language and Locale Identifiers canonicalization" -version = "1.3.0" license-file = "LICENSE" authors.workspace = true @@ -15,6 +14,7 @@ homepage.workspace = true include.workspace = true repository.workspace = true rust-version.workspace = true +version.workspace = true [package.metadata.cargo-all-features] skip_optional_dependencies = true diff --git a/components/segmenter/Cargo.toml b/components/segmenter/Cargo.toml index 938791444c4..059ffd2d580 100644 --- a/components/segmenter/Cargo.toml +++ b/components/segmenter/Cargo.toml @@ -5,7 +5,6 @@ [package] name = "icu_segmenter" description = "Unicode line breaking and text segmentation algorithms for text boundaries analysis" -version = "1.3.0" license-file = "LICENSE" authors.workspace = true @@ -15,6 +14,7 @@ homepage.workspace = true include.workspace = true repository.workspace = true rust-version.workspace = true +version.workspace = true [package.metadata.docs.rs] all-features = true diff --git a/experimental/compactdecimal/Cargo.toml b/experimental/compactdecimal/Cargo.toml index 666b5516fb0..221c4acb971 100644 --- a/experimental/compactdecimal/Cargo.toml +++ b/experimental/compactdecimal/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "icu_compactdecimal" description = "Compact decimal" -version = "0.2.1" +version = "0.2.2" license-file = "LICENSE" authors.workspace = true diff --git a/experimental/displaynames/Cargo.toml b/experimental/displaynames/Cargo.toml index ee2466f00a5..77fdd9407fc 100644 --- a/experimental/displaynames/Cargo.toml +++ b/experimental/displaynames/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "icu_displaynames" description = "API to enable the translation of Language and Region display names" -version = "0.11.0" +version = "0.11.1" license-file = "LICENSE" authors.workspace = true diff --git a/experimental/relativetime/Cargo.toml b/experimental/relativetime/Cargo.toml index 5549021cf72..ab728236e71 100644 --- a/experimental/relativetime/Cargo.toml +++ b/experimental/relativetime/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "icu_relativetime" description = "Relative time formatting" -version = "0.1.2" +version = "0.1.3" license-file = "LICENSE" authors.workspace = true diff --git a/experimental/transliterate/Cargo.toml b/experimental/transliterate/Cargo.toml index 06de04a4ad8..5ede21f4692 100644 --- a/experimental/transliterate/Cargo.toml +++ b/experimental/transliterate/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "icu_transliterate" description = "API for Transliteration" -version = "0.1.0" +version = "0.1.1" license-file = "LICENSE" authors.workspace = true diff --git a/experimental/unicodeset_parse/Cargo.toml b/experimental/unicodeset_parse/Cargo.toml index 4a38b1dd6f9..177adc9575a 100644 --- a/experimental/unicodeset_parse/Cargo.toml +++ b/experimental/unicodeset_parse/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "icu_unicodeset_parse" description = "API to parse unicode sets as defined in UTS35" -version = "0.1.0" +version = "0.1.1" license-file = "LICENSE" authors.workspace = true diff --git a/experimental/zerotrie/Cargo.toml b/experimental/zerotrie/Cargo.toml index 16ead742d9c..d7ee49cb84e 100644 --- a/experimental/zerotrie/Cargo.toml +++ b/experimental/zerotrie/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "zerotrie" description = "A data structure that efficiently maps strings to integers" -version = "0.1.0" +version = "0.1.1" license-file = "LICENSE" rust-version.workspace = true diff --git a/ffi/diplomat/Cargo.toml b/ffi/diplomat/Cargo.toml index 886cfe30705..de487e34492 100644 --- a/ffi/diplomat/Cargo.toml +++ b/ffi/diplomat/Cargo.toml @@ -5,7 +5,6 @@ [package] name = "icu_capi" description = "C interface to ICU4X" -version = "1.3.0" license-file = "LICENSE" include = [ "src/**/*", @@ -24,6 +23,7 @@ edition.workspace = true homepage.workspace = true repository.workspace = true rust-version.workspace = true +version.workspace = true [package.metadata.docs.rs] all-features = true diff --git a/ffi/diplomat/c/examples/fixeddecimal_tiny/icu_capi_staticlib_tiny/Cargo.lock b/ffi/diplomat/c/examples/fixeddecimal_tiny/icu_capi_staticlib_tiny/Cargo.lock index 2e4b3d6e443..e8fe305b212 100644 --- a/ffi/diplomat/c/examples/fixeddecimal_tiny/icu_capi_staticlib_tiny/Cargo.lock +++ b/ffi/diplomat/c/examples/fixeddecimal_tiny/icu_capi_staticlib_tiny/Cargo.lock @@ -2,10 +2,28 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "calendrical_calculations" +version = "0.1.0" +dependencies = [ + "core_maths", + "displaydoc", +] + +[[package]] +name = "core_maths" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b02505ccb8c50b0aa21ace0fc08c3e53adebd4e58caa18a36152803c7709a3" +dependencies = [ + "libm", +] + [[package]] name = "diplomat" -version = "0.5.2" -source = "git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9#8d125999893fedfdf30595e97334c21ec4b18da9" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92bd5669c330d5cafd10588707f6b75a1448f9758cb6fad19f83649fe1e2e9c" dependencies = [ "diplomat_core", "proc-macro2", @@ -15,13 +33,15 @@ dependencies = [ [[package]] name = "diplomat-runtime" -version = "0.5.2" -source = "git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9#8d125999893fedfdf30595e97334c21ec4b18da9" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0c0116d8e7fea6b2554fdb90289782b1e4e5e35d259525e4882a48ce09cbe7a" [[package]] name = "diplomat_core" -version = "0.5.2" -source = "git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9#8d125999893fedfdf30595e97334c21ec4b18da9" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c5577c28e7ed9d8f984ab7286a734a154307d09c976a3d6cb08d6fcb2f2740" dependencies = [ "lazy_static", "proc-macro2", @@ -60,7 +80,7 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "fixed_decimal" -version = "0.5.3" +version = "0.5.4" dependencies = [ "displaydoc", "ryu", @@ -70,14 +90,14 @@ dependencies = [ [[package]] name = "icu_calendar" -version = "1.2.0" +version = "1.3.2" dependencies = [ + "calendrical_calculations", "displaydoc", "icu_calendar_data", "icu_locid", "icu_locid_transform", "icu_provider", - "libm", "tinystr", "writeable", "zerovec", @@ -85,11 +105,11 @@ dependencies = [ [[package]] name = "icu_calendar_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_capi" -version = "1.2.2" +version = "1.3.2" dependencies = [ "diplomat", "diplomat-runtime", @@ -124,7 +144,7 @@ dependencies = [ [[package]] name = "icu_casemap" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "icu_casemap_data", @@ -133,17 +153,16 @@ dependencies = [ "icu_properties", "icu_provider", "writeable", - "yoke", "zerovec", ] [[package]] name = "icu_casemap_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_collator" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "icu_collator_data", @@ -161,11 +180,11 @@ dependencies = [ [[package]] name = "icu_collator_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_collections" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "yoke", @@ -175,7 +194,7 @@ dependencies = [ [[package]] name = "icu_datetime" -version = "1.2.1" +version = "1.3.2" dependencies = [ "displaydoc", "either", @@ -196,11 +215,11 @@ dependencies = [ [[package]] name = "icu_datetime_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_decimal" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "fixed_decimal", @@ -213,13 +232,12 @@ dependencies = [ [[package]] name = "icu_decimal_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_displaynames" -version = "0.10.0" +version = "0.11.1" dependencies = [ - "icu_collections", "icu_displaynames_data", "icu_locid", "icu_locid_transform", @@ -230,11 +248,11 @@ dependencies = [ [[package]] name = "icu_displaynames_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_list" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "icu_list_data", @@ -246,11 +264,11 @@ dependencies = [ [[package]] name = "icu_list_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_locid" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "litemap", @@ -261,7 +279,7 @@ dependencies = [ [[package]] name = "icu_locid_transform" -version = "1.2.1" +version = "1.3.2" dependencies = [ "displaydoc", "icu_locid", @@ -273,11 +291,11 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_normalizer" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "icu_collections", @@ -293,11 +311,11 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_plurals" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "fixed_decimal", @@ -310,11 +328,11 @@ dependencies = [ [[package]] name = "icu_plurals_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_properties" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "icu_collections", @@ -328,16 +346,17 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_provider" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "icu_locid", "icu_provider_macros", "stable_deref_trait", + "tinystr", "writeable", "yoke", "zerofrom", @@ -346,19 +365,18 @@ dependencies = [ [[package]] name = "icu_provider_adapters" -version = "1.2.0" +version = "1.3.2" dependencies = [ "icu_locid", "icu_locid_transform", "icu_provider", "tinystr", - "yoke", "zerovec", ] [[package]] name = "icu_provider_macros" -version = "1.2.0" +version = "1.3.2" dependencies = [ "proc-macro2", "quote", @@ -367,25 +385,25 @@ dependencies = [ [[package]] name = "icu_segmenter" -version = "1.2.1" +version = "1.3.2" dependencies = [ + "core_maths", "displaydoc", "icu_collections", "icu_locid", "icu_provider", "icu_segmenter_data", - "libm", "utf8_iter", "zerovec", ] [[package]] name = "icu_segmenter_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "icu_timezone" -version = "1.2.0" +version = "1.3.2" dependencies = [ "displaydoc", "icu_calendar", @@ -393,12 +411,13 @@ dependencies = [ "icu_provider", "icu_timezone_data", "tinystr", + "zerotrie", "zerovec", ] [[package]] name = "icu_timezone_data" -version = "1.3.0" +version = "1.3.2" [[package]] name = "lazy_static" @@ -420,7 +439,7 @@ checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "litemap" -version = "0.7.0" +version = "0.7.1" [[package]] name = "memchr" @@ -534,7 +553,7 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.1" +version = "0.7.4" dependencies = [ "displaydoc", "zerovec", @@ -578,11 +597,11 @@ checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" [[package]] name = "writeable" -version = "0.5.2" +version = "0.5.3" [[package]] name = "yoke" -version = "0.7.1" +version = "0.7.2" dependencies = [ "serde", "stable_deref_trait", @@ -592,7 +611,7 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.1" +version = "0.7.2" dependencies = [ "proc-macro2", "quote", @@ -602,14 +621,14 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.2" +version = "0.1.3" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.2" +version = "0.1.3" dependencies = [ "proc-macro2", "quote", @@ -617,9 +636,18 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zerotrie" +version = "0.1.1" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + [[package]] name = "zerovec" -version = "0.9.4" +version = "0.10.0" dependencies = [ "yoke", "zerofrom", @@ -628,10 +656,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.9.4" +version = "0.10.0" dependencies = [ "proc-macro2", "quote", "syn", - "synstructure", ] diff --git a/ffi/diplomat/src/locale_directionality.rs b/ffi/diplomat/src/locale_directionality.rs index 9166844f0a3..2ec83caff23 100644 --- a/ffi/diplomat/src/locale_directionality.rs +++ b/ffi/diplomat/src/locale_directionality.rs @@ -47,6 +47,7 @@ pub mod ffi { provider: &ICU4XDataProvider, expander: &ICU4XLocaleExpander, ) -> Result, ICU4XError> { + #[allow(unused_imports)] use icu_provider::prelude::*; Ok(Box::new(ICU4XLocaleDirectionality(match &provider.0 { ICU4XDataProviderInner::Destroyed => Err(icu_provider::DataError::custom( diff --git a/ffi/freertos/Cargo.toml b/ffi/freertos/Cargo.toml index 962a6be62aa..292e1f84345 100644 --- a/ffi/freertos/Cargo.toml +++ b/ffi/freertos/Cargo.toml @@ -5,7 +5,6 @@ [package] name = "icu_freertos" description = "C interface to ICU4X" -version = "1.3.0" license-file = "LICENSE" include = [ "build.rs", @@ -25,6 +24,7 @@ edition.workspace = true homepage.workspace = true repository.workspace = true rust-version.workspace = true +version.workspace = true [package.metadata.docs.rs] all-features = true diff --git a/provider/datagen/Cargo.toml b/provider/datagen/Cargo.toml index 9bc881eccb2..218498901eb 100644 --- a/provider/datagen/Cargo.toml +++ b/provider/datagen/Cargo.toml @@ -5,7 +5,6 @@ [package] name = "icu_datagen" description = "Generate data for ICU4X DataProvider" -version = "1.3.0" license-file = "LICENSE" include = [ "data/**/*", @@ -27,6 +26,7 @@ edition.workspace = true homepage.workspace = true repository.workspace = true rust-version.workspace = true +version.workspace = true [package.metadata.docs.rs] all-features = true diff --git a/provider/datagen/src/transform/cldr/source.rs b/provider/datagen/src/transform/cldr/source.rs index 8e4e73517fb..0bbdaef63e4 100644 --- a/provider/datagen/src/transform/cldr/source.rs +++ b/provider/datagen/src/transform/cldr/source.rs @@ -18,7 +18,6 @@ use once_cell::sync::OnceCell; use std::collections::HashSet; use std::fmt::Debug; use std::str::FromStr; -use std::sync::Mutex; #[derive(Debug)] pub(crate) struct CldrCache { @@ -27,7 +26,7 @@ pub(crate) struct CldrCache { locale_expander: OnceCell, #[cfg(feature = "icu_transliterate")] // used by transforms/mod.rs - pub(super) transforms: OnceCell>, + pub(super) transforms: OnceCell>, } impl CldrCache { diff --git a/provider/fs/Cargo.toml b/provider/fs/Cargo.toml index dff9e5421ab..06007c5275f 100644 --- a/provider/fs/Cargo.toml +++ b/provider/fs/Cargo.toml @@ -5,7 +5,6 @@ [package] name = "icu_provider_fs" description = "ICU4X data provider that reads from structured data files" -version = "1.3.0" license-file = "LICENSE" authors.workspace = true @@ -15,6 +14,7 @@ homepage.workspace = true include.workspace = true repository.workspace = true rust-version.workspace = true +version.workspace = true [package.metadata.docs.rs] all-features = true diff --git a/provider/testdata/Cargo.toml b/provider/testdata/Cargo.toml index 3be096b83a6..42d51744ef5 100644 --- a/provider/testdata/Cargo.toml +++ b/provider/testdata/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "icu_testdata" description = "Pre-built test data for ICU4X" -version = "1.3.0" +version = "1.3.2" rust-version = "1.66.0" authors = ["The ICU4X Project Developers"] edition = "2021" @@ -42,7 +42,7 @@ icu_provider_blob = { version = "~1.3.0", path = "../blob", default-features = f # databake deps icu_locid = { version = "~1.3.0", path = "../../components/locid", default-features = false } icu_collections = { version = "~1.3.0", path = "../../components/collections", default-features = false } -zerovec = { version = ">= 0.9.6, <0.11.0", path = "../../utils/zerovec", default-features = false } +zerovec = { version = "0.10.0", path = "../../utils/zerovec", default-features = false } zerotrie = { version = "0.1.0", path = "../../experimental/zerotrie" } # databake options diff --git a/utils/tinystr/Cargo.toml b/utils/tinystr/Cargo.toml index feb8d6e3349..0fe03e6026f 100644 --- a/utils/tinystr/Cargo.toml +++ b/utils/tinystr/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "tinystr" description = "A small ASCII-only bounded length string representation." -version = "0.7.3" +version = "0.7.4" keywords = ["string", "str", "small", "tiny", "no_std"] categories = ["data-structures"] license-file = "LICENSE" From 9e7e9a26eaba16320634d42d9a7da9aa8978a0ba Mon Sep 17 00:00:00 2001 From: Robert Bastian <4706271+robertbastian@users.noreply.github.com> Date: Tue, 26 Sep 2023 18:14:48 +0200 Subject: [PATCH 2/5] Fix duplicate features docs (#4097) --- components/calendar/src/week_of.rs | 4 ++++ provider/core/src/constructors.rs | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/calendar/src/week_of.rs b/components/calendar/src/week_of.rs index 259c120fd76..d108347c474 100644 --- a/components/calendar/src/week_of.rs +++ b/components/calendar/src/week_of.rs @@ -47,6 +47,10 @@ impl WeekCalculator { options: skip, error: CalendarError, /// Creates a new [`WeekCalculator`] from compiled locale data. + /// + /// ✨ *Enabled with the `compiled_data` Cargo feature.* + /// + /// [πŸ“š Help choosing a constructor](icu_provider::constructors) ); #[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::try_new)] diff --git a/provider/core/src/constructors.rs b/provider/core/src/constructors.rs index eeabe2c07ba..f521f1feab4 100644 --- a/provider/core/src/constructors.rs +++ b/provider/core/src/constructors.rs @@ -181,10 +181,6 @@ macro_rules! gen_any_buffer_data_constructors { (locale: skip, options: skip, result: $result_ty:path, $(#[$doc:meta])+ functions: [$baked:ident, $any:ident, $buffer:ident, $unstable:ident $(, $struct:ident)? $(,)?]) => { #[cfg(feature = "compiled_data")] $(#[$doc])+ - /// - /// ✨ *Enabled with the `compiled_data` Cargo feature.* - /// - /// [πŸ“š Help choosing a constructor](icu_provider::constructors) pub fn $baked() -> $result_ty { $($struct :: )? $unstable(&crate::provider::Baked) } From b68c42ec1db1e628392efc9c5770ac01020d30c2 Mon Sep 17 00:00:00 2001 From: Robert Bastian <4706271+robertbastian@users.noreply.github.com> Date: Fri, 29 Sep 2023 19:33:50 +0200 Subject: [PATCH 3/5] Fixing casemap docs (#4101) --- components/casemap/README.md | 9 +-------- components/casemap/src/casemapper.rs | 7 ------- components/casemap/src/closer.rs | 7 ------- components/casemap/src/lib.rs | 9 +-------- components/casemap/src/titlecase.rs | 7 ------- 5 files changed, 2 insertions(+), 37 deletions(-) diff --git a/components/casemap/README.md b/components/casemap/README.md index 23b1ae9f84b..ade3a9e1992 100644 --- a/components/casemap/README.md +++ b/components/casemap/README.md @@ -2,7 +2,7 @@ -🚧 \[Experimental\] Case mapping for Unicode characters and strings. +Case mapping for Unicode characters and strings. This module is published as its own crate ([`icu_casemap`](https://docs.rs/icu_casemap/latest/icu_casemap/)) and as part of the [`icu`](https://docs.rs/icu/latest/icu/) crate. See the latter for more details on the ICU4X project. @@ -25,13 +25,6 @@ assert_eq!( ); ``` -
-🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, -including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature -of the icu meta-crate. Use with caution. -#2535 -
- [`ICU4X`]: ../icu/index.html diff --git a/components/casemap/src/casemapper.rs b/components/casemap/src/casemapper.rs index 51e9393a582..fa18b040d98 100644 --- a/components/casemap/src/casemapper.rs +++ b/components/casemap/src/casemapper.rs @@ -33,13 +33,6 @@ use writeable::Writeable; /// "γΡιά σου ΞΊΟŒΟƒΞΌΞ΅" /// ); /// ``` -/// -///
-/// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, -/// including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature -/// of the icu meta-crate. Use with caution. -/// #2535 -///
#[derive(Clone, Debug)] pub struct CaseMapper { pub(crate) data: DataPayload, diff --git a/components/casemap/src/closer.rs b/components/casemap/src/closer.rs index 89ba80246cb..531f532ad16 100644 --- a/components/casemap/src/closer.rs +++ b/components/casemap/src/closer.rs @@ -34,13 +34,6 @@ use icu_provider::prelude::*; /// assert!(set.contains('ß')); /// assert!(set.contains('ẞ')); /// ``` -/// -///
-/// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, -/// including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature -/// of the icu meta-crate. Use with caution. -/// #2535 -///
#[derive(Clone, Debug)] pub struct CaseMapCloser { cm: CM, diff --git a/components/casemap/src/lib.rs b/components/casemap/src/lib.rs index e0e8a234c6f..6d2ec42246b 100644 --- a/components/casemap/src/lib.rs +++ b/components/casemap/src/lib.rs @@ -2,7 +2,7 @@ // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). -//! 🚧 \[Experimental\] Case mapping for Unicode characters and strings. +//! Case mapping for Unicode characters and strings. //! //! This module is published as its own crate ([`icu_casemap`](https://docs.rs/icu_casemap/latest/icu_casemap/)) //! and as part of the [`icu`](https://docs.rs/icu/latest/icu/) crate. See the latter for more details on the ICU4X project. @@ -25,13 +25,6 @@ //! ); //! ``` //! -//!
-//! 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, -//! including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature -//! of the icu meta-crate. Use with caution. -//! #2535 -//!
-//! //! [`ICU4X`]: ../icu/index.html // https://github.com/unicode-org/icu4x/blob/main/docs/process/boilerplate.md#library-annotations diff --git a/components/casemap/src/titlecase.rs b/components/casemap/src/titlecase.rs index 0b7016ddd23..c935eb09f2b 100644 --- a/components/casemap/src/titlecase.rs +++ b/components/casemap/src/titlecase.rs @@ -198,13 +198,6 @@ pub struct TitlecaseOptions { /// assert_eq!(cm.titlecase_segment_to_string("ijkdijk", &root, default_options), "Ijkdijk"); /// assert_eq!(cm.titlecase_segment_to_string("ijkdijk", &langid!("nl"), default_options), "IJkdijk"); // Dutch IJ digraph /// ``` -/// -///
-/// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, -/// including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature -/// of the icu meta-crate. Use with caution. -/// #2535 -///
#[derive(Clone, Debug)] pub struct TitlecaseMapper { cm: CM, From a766bbdfec165b7eca9dfcc5640763c69cbe2854 Mon Sep 17 00:00:00 2001 From: Robert Bastian <4706271+robertbastian@users.noreply.github.com> Date: Mon, 2 Oct 2023 08:14:02 +0200 Subject: [PATCH 4/5] Clean up `icu_datetime/experimental` (#4096) --- components/datetime/src/any/datetime.rs | 17 ++- components/datetime/src/any/zoned_datetime.rs | 9 +- components/datetime/src/datetime.rs | 45 +------- components/datetime/src/error.rs | 11 +- components/datetime/src/options/components.rs | 9 +- components/datetime/src/options/mod.rs | 2 + .../datetime/src/options/preferences.rs | 2 + components/datetime/src/provider/date_time.rs | 1 - components/datetime/src/raw/datetime.rs | 8 +- components/datetime/src/skeleton/error.rs | 7 ++ components/datetime/src/zoned_datetime.rs | 100 +++++++++--------- 11 files changed, 93 insertions(+), 118 deletions(-) diff --git a/components/datetime/src/any/datetime.rs b/components/datetime/src/any/datetime.rs index 10c46e92342..290b014ee9f 100644 --- a/components/datetime/src/any/datetime.rs +++ b/components/datetime/src/any/datetime.rs @@ -2,8 +2,6 @@ // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). -#[cfg(feature = "experimental")] -use crate::options::components; use crate::provider::{calendar::*, date_time::PatternSelector}; use crate::{calendar, options::DateTimeFormatterOptions, raw, DateFormatter, TimeFormatter}; use crate::{input::DateTimeInput, DateTimeError, FormattedDateTime}; @@ -277,7 +275,7 @@ impl DateTimeFormatter { /// Constructor that supports experimental options with compiled data. /// - /// ✨ *Enabled with the `compiled_data` Cargo feature.* + /// ✨ *Enabled with the `compiled_data` and `experimental` Cargo features.* /// /// [πŸ“š Help choosing a constructor](icu_provider::constructors) /// @@ -499,11 +497,20 @@ where { Ok(self.format(value)?.write_to_string().into_owned()) } - /// Returns a [`components::Bag`] that represents the resolved components for the + /// Returns a [`components::Bag`](crate::options::components::Bag) that represents the resolved components for the /// options that were provided to the [`DateTimeFormatter`]. The developer may request /// a certain set of options for a [`DateTimeFormatter`] but the locale and resolution /// algorithm may change certain details of what actually gets resolved. /// + /// ✨ *Enabled with the `experimental` Cargo feature.* + /// + ///
+ /// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, + /// including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature + /// of the icu meta-crate. Use with caution. + /// #1317 + ///
+ /// /// # Examples /// /// ``` @@ -529,7 +536,7 @@ where { /// assert_eq!(dtf.resolve_components(), expected_components_bag); /// ``` #[cfg(feature = "experimental")] - pub fn resolve_components(&self) -> components::Bag { + pub fn resolve_components(&self) -> crate::options::components::Bag { self.0.resolve_components() } diff --git a/components/datetime/src/any/zoned_datetime.rs b/components/datetime/src/any/zoned_datetime.rs index b45d45b5a6e..ab4b7911c7e 100644 --- a/components/datetime/src/any/zoned_datetime.rs +++ b/components/datetime/src/any/zoned_datetime.rs @@ -127,10 +127,17 @@ impl ZonedDateTimeFormatter { /// This method will pick the calendar off of the locale; and if unspecified or unknown will fall back to the default /// calendar for the locale. See [`AnyCalendarKind`] for a list of supported calendars. /// - /// ✨ *Enabled with the `compiled_data` Cargo feature.* + /// ✨ *Enabled with the `compiled_data` and `experimental` Cargo features.* /// /// [πŸ“š Help choosing a constructor](icu_provider::constructors) /// + ///
+ /// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, + /// including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature + /// of the icu meta-crate. Use with caution. + /// #1317 + ///
+ /// /// # Examples /// /// ``` diff --git a/components/datetime/src/datetime.rs b/components/datetime/src/datetime.rs index 3cffa9dcc01..51d54dd495c 100644 --- a/components/datetime/src/datetime.rs +++ b/components/datetime/src/datetime.rs @@ -24,9 +24,6 @@ use crate::{ DateTimeError, FormattedDateTime, }; -#[cfg(feature = "experimental")] -use crate::options::components; - /// [`TimeFormatter`] is a structure of the [`icu_datetime`] component that provides time formatting only. /// When constructed, it uses data from the [data provider], selected locale and provided preferences to /// collect all data necessary to format any time into that locale. @@ -591,7 +588,7 @@ where { /// Constructor that supports experimental options using compiled data. /// - /// ✨ *Enabled with the `compiled_data` Cargo feature.* + /// ✨ *Enabled with the `compiled_data` and `experimental` Cargo features.* /// /// [πŸ“š Help choosing a constructor](icu_provider::constructors) /// @@ -661,41 +658,7 @@ where { )) } - /// Constructor that supports experimental options. - /// - ///
- /// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, - /// including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature - /// of the icu meta-crate. Use with caution. - /// #1317 - ///
- /// - /// # Examples - /// - /// ``` - /// use icu::calendar::{DateTime, Gregorian}; - /// use icu::datetime::{options::components, TypedDateTimeFormatter}; - /// use icu::locid::locale; - /// use icu_provider::AsDeserializingBufferProvider; - /// use writeable::assert_writeable_eq; - /// - /// let mut options = components::Bag::default(); - /// options.year = Some(components::Year::Numeric); - /// options.month = Some(components::Month::Long); - /// - /// let dtf = TypedDateTimeFormatter::::try_new_experimental( - /// &locale!("en").into(), - /// options.into(), - /// ) - /// .unwrap(); - /// - /// let datetime = - /// DateTime::try_new_gregorian_datetime(2022, 8, 31, 1, 2, 3).unwrap(); - /// - /// assert_writeable_eq!(dtf.format(&datetime), "August 2022"); - /// ``` - /// - /// [data provider]: icu_provider + #[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::try_new_experimental)] #[cfg(feature = "experimental")] #[inline] pub fn try_new_experimental_unstable( @@ -781,7 +744,7 @@ where { self.format(value).write_to_string().into_owned() } - /// Returns a [`components::Bag`] that represents the resolved components for the + /// Returns a [`components::Bag`](crate::options::components::Bag) that represents the resolved components for the /// options that were provided to the [`TypedDateTimeFormatter`]. The developer may request /// a certain set of options for a [`TypedDateTimeFormatter`] but the locale and resolution /// algorithm may change certain details of what actually gets resolved. @@ -811,7 +774,7 @@ where { /// assert_eq!(dtf.resolve_components(), expected_components_bag); /// ``` #[cfg(feature = "experimental")] - pub fn resolve_components(&self) -> components::Bag { + pub fn resolve_components(&self) -> crate::options::components::Bag { self.0.resolve_components() } } diff --git a/components/datetime/src/error.rs b/components/datetime/src/error.rs index f9645f438b1..47ba9bbdefc 100644 --- a/components/datetime/src/error.rs +++ b/components/datetime/src/error.rs @@ -5,8 +5,6 @@ use crate::fields::FieldSymbol; use crate::input::CalendarError; use crate::pattern::PatternError; -#[cfg(feature = "experimental")] -use crate::skeleton::SkeletonError; use displaydoc::Display; use icu_calendar::any_calendar::AnyCalendarKind; use icu_calendar::types::MonthCode; @@ -39,7 +37,7 @@ pub enum DateTimeError { /// An error originating from skeleton matching. #[displaydoc("{0}")] #[cfg(feature = "experimental")] - Skeleton(SkeletonError), + Skeleton(crate::skeleton::SkeletonError), /// An error originating from an unsupported field in a datetime format. #[displaydoc("Unsupported field: {0:?}")] UnsupportedField(FieldSymbol), @@ -96,13 +94,6 @@ impl From for DateTimeError { } } -#[cfg(feature = "experimental")] -impl From for DateTimeError { - fn from(e: SkeletonError) -> Self { - DateTimeError::Skeleton(e) - } -} - impl From for DateTimeError { fn from(e: PluralsError) -> Self { DateTimeError::PluralRules(e) diff --git a/components/datetime/src/options/components.rs b/components/datetime/src/options/components.rs index 5666767e7c8..1d56474796a 100644 --- a/components/datetime/src/options/components.rs +++ b/components/datetime/src/options/components.rs @@ -4,6 +4,8 @@ //! 🚧 \[Experimental\] Options for constructing DateTimeFormatter objects by each component style. //! +//! ✨ *Enabled with the `experimental` Cargo feature.* +//! //!
//! 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, //! including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature @@ -85,9 +87,6 @@ use crate::{ pattern::{runtime::PatternPlurals, PatternItem}, }; -#[cfg(feature = "experimental")] -use alloc::vec::Vec; - use super::preferences; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; @@ -146,8 +145,8 @@ impl Bag { /// significant field to least significant. This is the order the fields are listed in /// the UTS 35 table - https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table #[cfg(any(test, feature = "experimental"))] // only used in test and experimental code - pub(crate) fn to_vec_fields(&self) -> Vec { - let mut fields = Vec::new(); + pub(crate) fn to_vec_fields(&self) -> alloc::vec::Vec { + let mut fields = alloc::vec::Vec::new(); if let Some(era) = self.era { fields.push(Field { symbol: FieldSymbol::Era, diff --git a/components/datetime/src/options/mod.rs b/components/datetime/src/options/mod.rs index 86c3dec63e4..72412620007 100644 --- a/components/datetime/src/options/mod.rs +++ b/components/datetime/src/options/mod.rs @@ -62,6 +62,8 @@ pub enum DateTimeFormatterOptions { Length(length::Bag), /// Bag of components describing which fields and how should be displayed. /// + /// ✨ *Enabled with the `experimental` Cargo feature.* + /// ///
/// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, /// including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature diff --git a/components/datetime/src/options/preferences.rs b/components/datetime/src/options/preferences.rs index 330319ad728..34913db6027 100644 --- a/components/datetime/src/options/preferences.rs +++ b/components/datetime/src/options/preferences.rs @@ -4,6 +4,8 @@ //! 🚧 \[Experimental\] Types to hold user preferences to configure a DateTimeFormatter. //! +//! ✨ *Enabled with the `experimental` Cargo feature.* +//! //! Preferences is a bag of options to be associated with either [`length::Bag`] or [`components::Bag`] //! which provides information on user preferences that can affect the result of the formatting. //! diff --git a/components/datetime/src/provider/date_time.rs b/components/datetime/src/provider/date_time.rs index e50826b5f60..e6f45ccf2d6 100644 --- a/components/datetime/src/provider/date_time.rs +++ b/components/datetime/src/provider/date_time.rs @@ -277,7 +277,6 @@ where ))) } - #[cfg(feature = "experimental")] fn skeleton_data_payload(&self) -> Result> { use icu_locid::extensions::unicode::{key, value}; use tinystr::tinystr; diff --git a/components/datetime/src/raw/datetime.rs b/components/datetime/src/raw/datetime.rs index c8137fd68f9..4baf875cc5e 100644 --- a/components/datetime/src/raw/datetime.rs +++ b/components/datetime/src/raw/datetime.rs @@ -5,8 +5,6 @@ //! The collection of code that is needed for handling formatting operations for DateTimes. //! Central to this is the [`DateTimeFormatter`]. -#[cfg(feature = "experimental")] -use crate::options::components; use crate::{ format::datetime, input::{DateInput, DateTimeInput, ExtractedDateTimeInput, IsoTimeInput}, @@ -526,10 +524,10 @@ impl DateTimeFormatter { } } - /// Returns a [`components::Bag`] that represents the resolved components for the + /// Returns a [`components::Bag`](crate::options::components::Bag) that represents the resolved components for the /// options that were provided to the [`DateTimeFormatter`]. #[cfg(feature = "experimental")] - pub fn resolve_components(&self) -> components::Bag { - components::Bag::from(&self.patterns.get().0) + pub fn resolve_components(&self) -> crate::options::components::Bag { + crate::options::components::Bag::from(&self.patterns.get().0) } } diff --git a/components/datetime/src/skeleton/error.rs b/components/datetime/src/skeleton/error.rs index 5584a1dc6e3..e85cb24bec8 100644 --- a/components/datetime/src/skeleton/error.rs +++ b/components/datetime/src/skeleton/error.rs @@ -34,6 +34,13 @@ pub enum SkeletonError { #[cfg(feature = "std")] impl std::error::Error for SkeletonError {} +#[cfg(feature = "experimental")] +impl From for crate::DateTimeError { + fn from(e: SkeletonError) -> Self { + crate::DateTimeError::Skeleton(e) + } +} + impl From for SkeletonError { fn from(e: fields::Error) -> Self { SkeletonError::Fields(e) diff --git a/components/datetime/src/zoned_datetime.rs b/components/datetime/src/zoned_datetime.rs index 4cda8686af1..2282fc2eeb9 100644 --- a/components/datetime/src/zoned_datetime.rs +++ b/components/datetime/src/zoned_datetime.rs @@ -85,32 +85,22 @@ impl TypedZonedDateTimeFormatter { /// /// [πŸ“š Help choosing a constructor](icu_provider::constructors) /// - ///
- /// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, - /// including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature - /// of the icu meta-crate. Use with caution. - /// #1317 - ///
- /// /// # Examples /// /// ``` /// use icu::calendar::{DateTime, Gregorian}; /// use icu::datetime::time_zone::TimeZoneFormatterOptions; - /// use icu::datetime::{options::components, TypedZonedDateTimeFormatter}; + /// use icu::datetime::{options::length, TypedZonedDateTimeFormatter}; /// use icu::locid::locale; /// use icu::timezone::CustomTimeZone; - /// use icu_provider::AsDeserializingBufferProvider; /// use writeable::assert_writeable_eq; /// - /// let mut options = components::Bag::default(); - /// options.year = Some(components::Year::Numeric); - /// options.month = Some(components::Month::Long); - /// options.hour = Some(components::Numeric::Numeric); - /// options.minute = Some(components::Numeric::Numeric); - /// options.time_zone_name = Some(components::TimeZoneName::GmtOffset); + /// let options = length::Bag::from_date_time_style( + /// length::Date::Medium, + /// length::Time::Long, + /// ); /// - /// let zdtf = TypedZonedDateTimeFormatter::::try_new_experimental( + /// let zdtf = TypedZonedDateTimeFormatter::::try_new( /// &locale!("en").into(), /// options.into(), /// TimeZoneFormatterOptions::default(), @@ -122,15 +112,14 @@ impl TypedZonedDateTimeFormatter { /// /// assert_writeable_eq!( /// zdtf.format(&datetime, &CustomTimeZone::utc()), - /// "August 2022, 01:02 GMT", + /// "Aug 31, 2022, 1:02:03β€―AM GMT", /// ); /// ``` /// /// [data provider]: icu_provider - #[cfg(feature = "experimental")] - #[cfg(feature = "compiled_data")] #[inline] - pub fn try_new_experimental( + #[cfg(feature = "compiled_data")] + pub fn try_new( locale: &DataLocale, date_time_format_options: DateTimeFormatterOptions, time_zone_format_options: TimeZoneFormatterOptions, @@ -139,11 +128,10 @@ impl TypedZonedDateTimeFormatter { crate::provider::Baked: DataProvider + DataProvider, { - let patterns = PatternSelector::for_options_experimental( + let patterns = PatternSelector::for_options( &crate::provider::Baked, calendar::load_lengths_for_cldr_calendar::(&crate::provider::Baked, locale)?, locale, - &C::DEFAULT_BCP_47_IDENTIFIER, &date_time_format_options, )?; Ok(Self( @@ -162,10 +150,17 @@ impl TypedZonedDateTimeFormatter { )) } - #[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::try_new_experimental)] - #[cfg(feature = "experimental")] + icu_provider::gen_any_buffer_data_constructors!( + locale: include, + date_time_format_options: DateTimeFormatterOptions, + time_zone_format_options: TimeZoneFormatterOptions, + error: DateTimeError, + #[cfg(skip)] + ); + + #[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::try_new)] #[inline] - pub fn try_new_experimental_unstable

( + pub fn try_new_unstable

( provider: &P, locale: &DataLocale, date_time_format_options: DateTimeFormatterOptions, @@ -176,7 +171,6 @@ impl TypedZonedDateTimeFormatter { + DataProvider<::DateLengthsV1Marker> + DataProvider + DataProvider - + DataProvider + DataProvider + DataProvider + DataProvider @@ -188,11 +182,10 @@ impl TypedZonedDateTimeFormatter { + DataProvider + ?Sized, { - let patterns = PatternSelector::for_options_experimental( + let patterns = PatternSelector::for_options( provider, calendar::load_lengths_for_cldr_calendar::(provider, locale)?, locale, - &C::DEFAULT_BCP_47_IDENTIFIER, &date_time_format_options, )?; Ok(Self( @@ -210,26 +203,36 @@ impl TypedZonedDateTimeFormatter { /// Constructor that takes a selected locale and a list of [`DateTimeFormatterOptions`]. /// It collects all data necessary to format zoned datetime values into the given locale. /// - /// ✨ *Enabled with the `compiled_data` Cargo feature.* + /// ✨ *Enabled with the `compiled_data` and `experimental` Cargo features.* /// /// [πŸ“š Help choosing a constructor](icu_provider::constructors) /// + ///

+ /// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, + /// including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature + /// of the icu meta-crate. Use with caution. + /// #1317 + ///
+ /// /// # Examples /// /// ``` /// use icu::calendar::{DateTime, Gregorian}; /// use icu::datetime::time_zone::TimeZoneFormatterOptions; - /// use icu::datetime::{options::length, TypedZonedDateTimeFormatter}; + /// use icu::datetime::{options::components, TypedZonedDateTimeFormatter}; /// use icu::locid::locale; /// use icu::timezone::CustomTimeZone; + /// use icu_provider::AsDeserializingBufferProvider; /// use writeable::assert_writeable_eq; /// - /// let options = length::Bag::from_date_time_style( - /// length::Date::Medium, - /// length::Time::Long, - /// ); + /// let mut options = components::Bag::default(); + /// options.year = Some(components::Year::Numeric); + /// options.month = Some(components::Month::Long); + /// options.hour = Some(components::Numeric::Numeric); + /// options.minute = Some(components::Numeric::Numeric); + /// options.time_zone_name = Some(components::TimeZoneName::GmtOffset); /// - /// let zdtf = TypedZonedDateTimeFormatter::::try_new( + /// let zdtf = TypedZonedDateTimeFormatter::::try_new_experimental( /// &locale!("en").into(), /// options.into(), /// TimeZoneFormatterOptions::default(), @@ -241,14 +244,15 @@ impl TypedZonedDateTimeFormatter { /// /// assert_writeable_eq!( /// zdtf.format(&datetime, &CustomTimeZone::utc()), - /// "Aug 31, 2022, 1:02:03β€―AM GMT", + /// "August 2022, 01:02 GMT", /// ); /// ``` /// /// [data provider]: icu_provider - #[inline] + #[cfg(feature = "experimental")] #[cfg(feature = "compiled_data")] - pub fn try_new( + #[inline] + pub fn try_new_experimental( locale: &DataLocale, date_time_format_options: DateTimeFormatterOptions, time_zone_format_options: TimeZoneFormatterOptions, @@ -257,10 +261,11 @@ impl TypedZonedDateTimeFormatter { crate::provider::Baked: DataProvider + DataProvider, { - let patterns = PatternSelector::for_options( + let patterns = PatternSelector::for_options_experimental( &crate::provider::Baked, calendar::load_lengths_for_cldr_calendar::(&crate::provider::Baked, locale)?, locale, + &C::DEFAULT_BCP_47_IDENTIFIER, &date_time_format_options, )?; Ok(Self( @@ -279,17 +284,10 @@ impl TypedZonedDateTimeFormatter { )) } - icu_provider::gen_any_buffer_data_constructors!( - locale: include, - date_time_format_options: DateTimeFormatterOptions, - time_zone_format_options: TimeZoneFormatterOptions, - error: DateTimeError, - #[cfg(skip)] - ); - - #[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::try_new)] + #[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::try_new_experimental)] + #[cfg(feature = "experimental")] #[inline] - pub fn try_new_unstable

( + pub fn try_new_experimental_unstable

( provider: &P, locale: &DataLocale, date_time_format_options: DateTimeFormatterOptions, @@ -300,6 +298,7 @@ impl TypedZonedDateTimeFormatter { + DataProvider<::DateLengthsV1Marker> + DataProvider + DataProvider + + DataProvider + DataProvider + DataProvider + DataProvider @@ -311,10 +310,11 @@ impl TypedZonedDateTimeFormatter { + DataProvider + ?Sized, { - let patterns = PatternSelector::for_options( + let patterns = PatternSelector::for_options_experimental( provider, calendar::load_lengths_for_cldr_calendar::(provider, locale)?, locale, + &C::DEFAULT_BCP_47_IDENTIFIER, &date_time_format_options, )?; Ok(Self( From ac390154c7650010a819ee58bd48552e64f2c3f0 Mon Sep 17 00:00:00 2001 From: Robert Bastian <4706271+robertbastian@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:55:58 +0200 Subject: [PATCH 5/5] Improving `icu_locid_transform` docs (#4099) --- .../locid_transform/src/canonicalizer.rs | 10 +---- .../locid_transform/src/directionality.rs | 5 +-- components/locid_transform/src/expander.rs | 14 ++----- .../locid_transform/src/fallback/mod.rs | 41 +++++++++++++++++-- components/locid_transform/src/lib.rs | 2 + ffi/diplomat/src/fallbacker.rs | 2 +- provider/adapters/src/fallback/mod.rs | 2 +- provider/core/src/fallback.rs | 8 ++-- provider/datagen/src/driver.rs | 2 +- 9 files changed, 53 insertions(+), 33 deletions(-) diff --git a/components/locid_transform/src/canonicalizer.rs b/components/locid_transform/src/canonicalizer.rs index cbbb92e1449..5a3782638a1 100644 --- a/components/locid_transform/src/canonicalizer.rs +++ b/components/locid_transform/src/canonicalizer.rs @@ -20,11 +20,7 @@ use icu_locid::{ use icu_provider::prelude::*; use tinystr::TinyAsciiStr; -/// The LocaleCanonicalizer provides methods to canonicalize Locales and -/// LanguageIdentifiers based upon [`CLDR`] data. -/// -/// It currently supports locale canonicalization based upon the canonicalization -/// algorithm from [`UTS #35: Unicode LDML 3. LocaleId Canonicalization`]. +/// Implements the algorithm defined in *[UTS #35: Annex C, LocaleId Canonicalization]*. /// /// # Examples /// @@ -39,9 +35,7 @@ use tinystr::TinyAsciiStr; /// assert_eq!(locale, "ja-Latn-alalc97-fonipa".parse().unwrap()); /// ``` /// -/// [`ICU4X`]: ../icu/index.html -/// [`CLDR`]: http://cldr.unicode.org/ -/// [`UTS #35: Unicode LDML 3. LocaleId Canonicalization`]: http://unicode.org/reports/tr35/#LocaleId_Canonicalization, +/// [UTS #35: Annex C, LocaleId Canonicalization]: http://unicode.org/reports/tr35/#LocaleId_Canonicalization #[derive(Debug)] pub struct LocaleCanonicalizer { /// Data to support canonicalization. diff --git a/components/locid_transform/src/directionality.rs b/components/locid_transform/src/directionality.rs index 67bacb3947b..8a6c243b81b 100644 --- a/components/locid_transform/src/directionality.rs +++ b/components/locid_transform/src/directionality.rs @@ -20,8 +20,7 @@ pub enum Direction { RightToLeft, } -/// The `LocaleDirectionality` provides methods to determine the direction of a locale based -/// on [`CLDR`] data. +/// Provides methods to determine the direction of a locale. /// /// # Examples /// @@ -33,8 +32,6 @@ pub enum Direction { /// /// assert_eq!(ld.get(&locale!("en")), Some(Direction::LeftToRight)); /// ``` -/// -/// [`CLDR`]: http://cldr.unicode.org/ #[derive(Debug)] pub struct LocaleDirectionality { script_direction: DataPayload, diff --git a/components/locid_transform/src/expander.rs b/components/locid_transform/src/expander.rs index ead15fff1c9..56f204c324d 100644 --- a/components/locid_transform/src/expander.rs +++ b/components/locid_transform/src/expander.rs @@ -11,15 +11,8 @@ use icu_provider::prelude::*; use crate::TransformResult; -/// LocaleExpander supports the `minimize` and `maximize` likely subtags -/// algorithms as described in [`UTS #35: Unicode LDML 3. Likely Subtags`]. -/// -/// The maximize method potentially updates a passed in locale in place -/// depending up the results of running the 'Add Likely Subtags' algorithm -/// from [`UTS #35: Unicode LDML 3. Likely Subtags`]. -/// -/// This minimize method returns a new Locale that is the result of running the -/// 'Remove Likely Subtags' algorithm from [`UTS #35: Unicode LDML 3. Likely Subtags`]. +/// Implements the *Add Likely Subtags* and *Remove Likely Subtags* +/// algorithms as defined in *[UTS #35: Likely Subtags]*. /// /// # Examples /// @@ -71,8 +64,7 @@ use crate::TransformResult; /// assert_eq!(locale, locale!("atj-Latn-CA")); /// ``` /// -/// [`CLDR`]: http://cldr.unicode.org/ -/// [`UTS #35: Unicode LDML 3. Likely Subtags`]: https://www.unicode.org/reports/tr35/#Likely_Subtags. +/// [UTS #35: Likely Subtags]: https://www.unicode.org/reports/tr35/#Likely_Subtags #[derive(Debug, Clone)] pub struct LocaleExpander { likely_subtags_l: DataPayload, diff --git a/components/locid_transform/src/fallback/mod.rs b/components/locid_transform/src/fallback/mod.rs index db92dff3388..6b13e020143 100644 --- a/components/locid_transform/src/fallback/mod.rs +++ b/components/locid_transform/src/fallback/mod.rs @@ -14,7 +14,7 @@ //! //! ``` //! use icu_locid::locale; -//! use icu_locid_transform::fallback::LocaleFallbacker; +//! use icu_locid_transform::LocaleFallbacker; //! //! // Set up a LocaleFallbacker with data. //! let fallbacker = LocaleFallbacker::new(); @@ -49,9 +49,44 @@ pub use icu_provider::fallback::*; mod algorithms; -/// Entry type for locale fallbacking. +/// Implements the algorithm defined in *[UTS #35: Locale Inheritance and Matching]*. /// -/// See the module-level documentation for an example. +/// Note that this implementation performs some additional steps compared to the *UTS #35* +/// algorithm, see *[the design doc]* for a detailed description, and [#2243]( +/// https://github.com/unicode-org/icu4x/issues/2243) to track aligment with *UTS #35*. +/// +/// # Examples +/// +/// ``` +/// use icu_locid::locale; +/// use icu_locid_transform::fallback::LocaleFallbacker; +/// +/// // Set up a LocaleFallbacker with data. +/// let fallbacker = LocaleFallbacker::new(); +/// +/// // Create a LocaleFallbackerIterator with a default configuration. +/// // By default, uses language priority with no additional extension keywords. +/// let mut fallback_iterator = fallbacker +/// .for_config(Default::default()) +/// .fallback_for(locale!("hi-Latn-IN").into()); +/// +/// // Run the algorithm and check the results. +/// assert_eq!(fallback_iterator.get(), &locale!("hi-Latn-IN").into()); +/// fallback_iterator.step(); +/// assert_eq!(fallback_iterator.get(), &locale!("hi-Latn").into()); +/// fallback_iterator.step(); +/// assert_eq!(fallback_iterator.get(), &locale!("en-IN").into()); +/// fallback_iterator.step(); +/// assert_eq!(fallback_iterator.get(), &locale!("en-001").into()); +/// fallback_iterator.step(); +/// assert_eq!(fallback_iterator.get(), &locale!("en").into()); +/// fallback_iterator.step(); +/// assert_eq!(fallback_iterator.get(), &locale!("und").into()); +/// ``` +/// +/// [UTS #35: Locale Inheritance and Matching]: https://www.unicode.org/reports/tr35/#Locale_Inheritance +/// [the design doc]: https://docs.google.com/document/d/1Mp7EUyl-sFh_HZYgyeVwj88vJGpCBIWxzlCwGgLCDwM/edit +#[doc(hidden)] #[derive(Debug, Clone, PartialEq)] pub struct LocaleFallbacker { likely_subtags: DataPayload, diff --git a/components/locid_transform/src/lib.rs b/components/locid_transform/src/lib.rs index a6aa4cf2bb8..4c4e34aeae2 100644 --- a/components/locid_transform/src/lib.rs +++ b/components/locid_transform/src/lib.rs @@ -99,6 +99,8 @@ pub use canonicalizer::LocaleCanonicalizer; pub use directionality::{Direction, LocaleDirectionality}; pub use error::LocaleTransformError; pub use expander::LocaleExpander; +#[doc(inline)] +pub use fallback::LocaleFallbacker; /// Used to track the result of a transformation operation that potentially modifies its argument in place. #[derive(Debug, PartialEq)] diff --git a/ffi/diplomat/src/fallbacker.rs b/ffi/diplomat/src/fallbacker.rs index d616d503684..b3f21b7530a 100644 --- a/ffi/diplomat/src/fallbacker.rs +++ b/ffi/diplomat/src/fallbacker.rs @@ -8,8 +8,8 @@ pub mod ffi { use icu_locid_transform::fallback::LocaleFallbackConfig; use icu_locid_transform::fallback::LocaleFallbackIterator; use icu_locid_transform::fallback::LocaleFallbackPriority; - use icu_locid_transform::fallback::LocaleFallbacker; use icu_locid_transform::fallback::LocaleFallbackerWithConfig; + use icu_locid_transform::LocaleFallbacker; use crate::{ errors::ffi::ICU4XError, locale::ffi::ICU4XLocale, provider::ffi::ICU4XDataProvider, diff --git a/provider/adapters/src/fallback/mod.rs b/provider/adapters/src/fallback/mod.rs index be5e79a524f..c0a05d14ec2 100644 --- a/provider/adapters/src/fallback/mod.rs +++ b/provider/adapters/src/fallback/mod.rs @@ -126,7 +126,7 @@ impl

LocaleFallbackProvider

{ /// /// ``` /// use icu_locid::locale; - /// use icu_locid_transform::fallback::LocaleFallbacker; + /// use icu_locid_transform::LocaleFallbacker; /// use icu_provider::hello_world::*; /// use icu_provider::prelude::*; /// use icu_provider_adapters::fallback::LocaleFallbackProvider; diff --git a/provider/core/src/fallback.rs b/provider/core/src/fallback.rs index c1cb4f6c37a..5c4e13b8da6 100644 --- a/provider/core/src/fallback.rs +++ b/provider/core/src/fallback.rs @@ -65,7 +65,7 @@ pub struct LocaleFallbackConfig { /// use icu_locid::locale; /// use icu_locid_transform::fallback::LocaleFallbackConfig; /// use icu_locid_transform::fallback::LocaleFallbackPriority; - /// use icu_locid_transform::fallback::LocaleFallbacker; + /// use icu_locid_transform::LocaleFallbacker; /// /// // Set up the fallback iterator. /// let fallbacker = LocaleFallbacker::new(); @@ -93,7 +93,7 @@ pub struct LocaleFallbackConfig { /// use icu_locid::locale; /// use icu_locid_transform::fallback::LocaleFallbackConfig; /// use icu_locid_transform::fallback::LocaleFallbackPriority; - /// use icu_locid_transform::fallback::LocaleFallbacker; + /// use icu_locid_transform::LocaleFallbacker; /// /// // Set up the fallback iterator. /// let fallbacker = LocaleFallbacker::new(); @@ -122,7 +122,7 @@ pub struct LocaleFallbackConfig { /// ``` /// use icu_locid::locale; /// use icu_locid_transform::fallback::LocaleFallbackConfig; - /// use icu_locid_transform::fallback::LocaleFallbacker; + /// use icu_locid_transform::LocaleFallbacker; /// /// // Set up the fallback iterator. /// let fallbacker = LocaleFallbacker::new(); @@ -159,7 +159,7 @@ pub struct LocaleFallbackConfig { /// use icu_locid_transform::fallback::LocaleFallbackConfig; /// use icu_locid_transform::fallback::LocaleFallbackPriority; /// use icu_locid_transform::fallback::LocaleFallbackSupplement; - /// use icu_locid_transform::fallback::LocaleFallbacker; + /// use icu_locid_transform::LocaleFallbacker; /// /// // Set up the fallback iterator. /// let fallbacker = LocaleFallbacker::new(); diff --git a/provider/datagen/src/driver.rs b/provider/datagen/src/driver.rs index 91e6d1b7218..78faac91c61 100644 --- a/provider/datagen/src/driver.rs +++ b/provider/datagen/src/driver.rs @@ -7,7 +7,7 @@ use crate::FallbackMode; use icu_locid::extensions::unicode::key; use icu_locid::LanguageIdentifier; use icu_locid_transform::fallback::LocaleFallbackIterator; -use icu_locid_transform::fallback::LocaleFallbacker; +use icu_locid_transform::LocaleFallbacker; use icu_provider::datagen::*; use icu_provider::prelude::*; use once_cell::sync::Lazy;