From c11227b5f67ecd244d882d941bbcae1c823e7dc3 Mon Sep 17 00:00:00 2001 From: Zibi Braniecki Date: Fri, 9 Oct 2020 12:16:13 -0700 Subject: [PATCH] Switch to short names and underscores --- CODEOWNERS | 6 ++-- Cargo.toml | 10 +++--- .../Cargo.toml | 8 ++--- .../README.md | 0 .../src/cldr_langid.rs | 0 .../src/cldr_paths.rs | 0 .../src/download/cldr_paths_download.rs | 0 .../src/download/error.rs | 0 .../src/download/io_util.rs | 0 .../src/download/mod.rs | 0 .../src/error.rs | 0 .../src/lib.rs | 2 +- .../src/reader.rs | 0 .../src/support.rs | 0 .../src/transform/dates.rs | 0 .../src/transform/mod.rs | 0 .../src/transform/plurals.rs | 2 +- .../tests/testdata/cs-ca-gregorian.json | 0 .../tests/testdata/dummy.pdf | Bin .../tests/testdata/dummy.zip | Bin .../tests/testdata/haw-ca-gregorian.json | 0 .../tests/testdata/plurals.json | 0 .../Cargo.toml | 4 +-- .../README.md | 0 .../src/cloneable_any.rs | 0 .../src/data_entry.rs | 0 .../src/data_key.rs | 0 .../src/data_provider.rs | 0 .../src/error.rs | 0 .../src/invariant.rs | 0 .../src/iter.rs | 0 .../src/lib.rs | 2 +- .../src/structs/dates.rs | 0 .../src/structs/decimal.rs | 0 .../src/structs/mod.rs | 0 .../src/structs/plurals.rs | 0 .../tests/json_warehouse.rs | 0 components/datetime/Cargo.toml | 10 +++--- components/datetime/src/lib.rs | 4 +-- .../Cargo.toml | 12 +++---- .../README.md | 0 .../src/bin/icu4x-cldr-export.rs | 0 .../src/error.rs | 0 .../src/export/aliasing.rs | 0 .../src/export/fs_exporter.rs | 0 .../src/export/mod.rs | 0 .../src/export/serializers.rs | 0 .../src/fs_data_provider.rs | 0 .../src/lib.rs | 2 +- .../src/manifest.rs | 0 .../tests/test_file_io.rs | 0 components/icu/Cargo.toml | 10 +++--- components/icu/src/lib.rs | 4 +-- components/locale/Cargo.toml | 2 +- components/locale/README.md | 2 +- components/locale/macros/Cargo.toml | 6 ++-- components/locale/src/lib.rs | 2 +- .../{pluralrules => plurals}/Cargo.toml | 14 ++++---- .../benches/fixtures/mod.rs | 2 +- .../benches/fixtures/numbers.json | 0 .../benches/fixtures/plurals.json | 0 .../benches/helpers/mod.rs | 0 .../benches/operands.rs | 2 +- .../benches/parser.rs | 4 +-- .../benches/pluralrules.rs | 2 +- .../examples/elevator_floors.rs | 4 +-- .../examples/unread_emails.rs | 4 +-- .../{pluralrules => plurals}/src/data.rs | 4 +-- .../{pluralrules => plurals}/src/error.rs | 0 .../{pluralrules => plurals}/src/lib.rs | 18 +++++----- .../{pluralrules => plurals}/src/operands.rs | 6 ++-- .../{pluralrules => plurals}/src/rules/ast.rs | 34 +++++++++--------- .../src/rules/lexer.rs | 4 +-- .../{pluralrules => plurals}/src/rules/mod.rs | 10 +++--- .../src/rules/parser.rs | 4 +-- .../src/rules/resolver.rs | 4 +-- .../src/rules/serializer.rs | 6 ++-- .../tests/fixtures/mod.rs | 2 +- .../tests/fixtures/operands.json | 0 .../tests/fixtures/rules.json | 0 .../{pluralrules => plurals}/tests/helpers.rs | 0 .../tests/operands.rs | 2 +- .../{pluralrules => plurals}/tests/plurals.rs | 2 +- .../{pluralrules => plurals}/tests/rules.rs | 4 +-- components/uniset/Cargo.toml | 4 +-- components/uniset/benches/inv_list.rs | 2 +- .../examples/unicode_bmp_blocks_selector.rs | 2 +- components/uniset/src/builder.rs | 26 +++++++------- components/uniset/src/lib.rs | 6 ++-- components/uniset/src/uniset.rs | 18 +++++----- docs/style-guide.md | 24 ++++++------- resources/testdata/Cargo.toml | 16 ++++----- resources/testdata/src/lib.rs | 2 +- .../Cargo.toml | 2 +- .../README.md | 0 .../benches/fixed_decimal.rs | 0 .../examples/permyriad.rs | 0 .../src/decimal.rs | 0 .../src/lib.rs | 0 .../src/uint_iterator.rs | 0 100 files changed, 161 insertions(+), 161 deletions(-) rename components/{cldr-json-data-provider => cldr_json_data_provider}/Cargo.toml (85%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/README.md (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/cldr_langid.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/cldr_paths.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/download/cldr_paths_download.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/download/error.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/download/io_util.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/download/mod.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/error.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/lib.rs (93%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/reader.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/support.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/transform/dates.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/transform/mod.rs (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/src/transform/plurals.rs (99%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/tests/testdata/cs-ca-gregorian.json (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/tests/testdata/dummy.pdf (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/tests/testdata/dummy.zip (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/tests/testdata/haw-ca-gregorian.json (100%) rename components/{cldr-json-data-provider => cldr_json_data_provider}/tests/testdata/plurals.json (100%) rename components/{data-provider => data_provider}/Cargo.toml (91%) rename components/{data-provider => data_provider}/README.md (100%) rename components/{data-provider => data_provider}/src/cloneable_any.rs (100%) rename components/{data-provider => data_provider}/src/data_entry.rs (100%) rename components/{data-provider => data_provider}/src/data_key.rs (100%) rename components/{data-provider => data_provider}/src/data_provider.rs (100%) rename components/{data-provider => data_provider}/src/error.rs (100%) rename components/{data-provider => data_provider}/src/invariant.rs (100%) rename components/{data-provider => data_provider}/src/iter.rs (100%) rename components/{data-provider => data_provider}/src/lib.rs (98%) rename components/{data-provider => data_provider}/src/structs/dates.rs (100%) rename components/{data-provider => data_provider}/src/structs/decimal.rs (100%) rename components/{data-provider => data_provider}/src/structs/mod.rs (100%) rename components/{data-provider => data_provider}/src/structs/plurals.rs (100%) rename components/{data-provider => data_provider}/tests/json_warehouse.rs (100%) rename components/{fs-data-provider => fs_data_provider}/Cargo.toml (72%) rename components/{fs-data-provider => fs_data_provider}/README.md (100%) rename components/{fs-data-provider => fs_data_provider}/src/bin/icu4x-cldr-export.rs (100%) rename components/{fs-data-provider => fs_data_provider}/src/error.rs (100%) rename components/{fs-data-provider => fs_data_provider}/src/export/aliasing.rs (100%) rename components/{fs-data-provider => fs_data_provider}/src/export/fs_exporter.rs (100%) rename components/{fs-data-provider => fs_data_provider}/src/export/mod.rs (100%) rename components/{fs-data-provider => fs_data_provider}/src/export/serializers.rs (100%) rename components/{fs-data-provider => fs_data_provider}/src/fs_data_provider.rs (100%) rename components/{fs-data-provider => fs_data_provider}/src/lib.rs (90%) rename components/{fs-data-provider => fs_data_provider}/src/manifest.rs (100%) rename components/{fs-data-provider => fs_data_provider}/tests/test_file_io.rs (100%) rename components/{pluralrules => plurals}/Cargo.toml (66%) rename components/{pluralrules => plurals}/benches/fixtures/mod.rs (97%) rename components/{pluralrules => plurals}/benches/fixtures/numbers.json (100%) rename components/{pluralrules => plurals}/benches/fixtures/plurals.json (100%) rename components/{pluralrules => plurals}/benches/helpers/mod.rs (100%) rename components/{pluralrules => plurals}/benches/operands.rs (99%) rename components/{pluralrules => plurals}/benches/parser.rs (94%) rename components/{pluralrules => plurals}/benches/pluralrules.rs (96%) rename components/{pluralrules => plurals}/examples/elevator_floors.rs (89%) rename components/{pluralrules => plurals}/examples/unread_emails.rs (87%) rename components/{pluralrules => plurals}/src/data.rs (97%) rename components/{pluralrules => plurals}/src/error.rs (100%) rename components/{pluralrules => plurals}/src/lib.rs (95%) rename components/{pluralrules => plurals}/src/operands.rs (98%) rename components/{pluralrules => plurals}/src/rules/ast.rs (93%) rename components/{pluralrules => plurals}/src/rules/lexer.rs (98%) rename components/{pluralrules => plurals}/src/rules/mod.rs (95%) rename components/{pluralrules => plurals}/src/rules/parser.rs (99%) rename components/{pluralrules => plurals}/src/rules/resolver.rs (96%) rename components/{pluralrules => plurals}/src/rules/serializer.rs (97%) rename components/{pluralrules => plurals}/tests/fixtures/mod.rs (98%) rename components/{pluralrules => plurals}/tests/fixtures/operands.json (100%) rename components/{pluralrules => plurals}/tests/fixtures/rules.json (100%) rename components/{pluralrules => plurals}/tests/helpers.rs (100%) rename components/{pluralrules => plurals}/tests/operands.rs (98%) rename components/{pluralrules => plurals}/tests/plurals.rs (91%) rename components/{pluralrules => plurals}/tests/rules.rs (89%) rename utils/{fixed-decimal => fixed_decimal}/Cargo.toml (96%) rename utils/{fixed-decimal => fixed_decimal}/README.md (100%) rename utils/{fixed-decimal => fixed_decimal}/benches/fixed_decimal.rs (100%) rename utils/{fixed-decimal => fixed_decimal}/examples/permyriad.rs (100%) rename utils/{fixed-decimal => fixed_decimal}/src/decimal.rs (100%) rename utils/{fixed-decimal => fixed_decimal}/src/lib.rs (100%) rename utils/{fixed-decimal => fixed_decimal}/src/uint_iterator.rs (100%) diff --git a/CODEOWNERS b/CODEOWNERS index fa307a675ba..fc83ef870a3 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -8,6 +8,6 @@ # List of components with at least two owners as specified in docs/crate-ownership. components/locale/ @zbraniecki @nciric -components/pluralrules @zbraniecki @sffc -components/data-provider/ @sffc -components/data-provider-json/ @sffc +components/plurals/ @zbraniecki @sffc +components/data_provider/ @sffc +components/data_provider_json/ @sffc diff --git a/Cargo.toml b/Cargo.toml index a1f7111aaf7..7c3132da0fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,16 +1,16 @@ [workspace] members = [ - "components/cldr-json-data-provider", - "components/data-provider", - "components/fs-data-provider", + "components/cldr_json_data_provider", + "components/data_provider", + "components/fs_data_provider", "components/icu", "components/icu4x", "components/uniset", "components/locale", "components/locale/macros", - "components/pluralrules", + "components/plurals", "components/datetime", "resources/testdata", - "utils/fixed-decimal", + "utils/fixed_decimal", ] diff --git a/components/cldr-json-data-provider/Cargo.toml b/components/cldr_json_data_provider/Cargo.toml similarity index 85% rename from components/cldr-json-data-provider/Cargo.toml rename to components/cldr_json_data_provider/Cargo.toml index 8d2a8de176f..11fea3112e0 100644 --- a/components/cldr-json-data-provider/Cargo.toml +++ b/components/cldr_json_data_provider/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "icu-cldr-json-data-provider" +name = "icu_cldr_json_data_provider" description = "Data provider that reads from a CLDR JSON data source" version = "0.0.1" authors = ["The ICU4X Project Developers"] @@ -15,9 +15,9 @@ include = [ ] [dependencies] -icu-data-provider = { path = "../data-provider" } -icu-locale = { path = "../locale" } -icu-pluralrules = { path = "../pluralrules" } +icu_data_provider = { path = "../data_provider" } +icu_locale = { path = "../locale" } +icu_plurals = { path = "../plurals" } json = "0.12" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/components/cldr-json-data-provider/README.md b/components/cldr_json_data_provider/README.md similarity index 100% rename from components/cldr-json-data-provider/README.md rename to components/cldr_json_data_provider/README.md diff --git a/components/cldr-json-data-provider/src/cldr_langid.rs b/components/cldr_json_data_provider/src/cldr_langid.rs similarity index 100% rename from components/cldr-json-data-provider/src/cldr_langid.rs rename to components/cldr_json_data_provider/src/cldr_langid.rs diff --git a/components/cldr-json-data-provider/src/cldr_paths.rs b/components/cldr_json_data_provider/src/cldr_paths.rs similarity index 100% rename from components/cldr-json-data-provider/src/cldr_paths.rs rename to components/cldr_json_data_provider/src/cldr_paths.rs diff --git a/components/cldr-json-data-provider/src/download/cldr_paths_download.rs b/components/cldr_json_data_provider/src/download/cldr_paths_download.rs similarity index 100% rename from components/cldr-json-data-provider/src/download/cldr_paths_download.rs rename to components/cldr_json_data_provider/src/download/cldr_paths_download.rs diff --git a/components/cldr-json-data-provider/src/download/error.rs b/components/cldr_json_data_provider/src/download/error.rs similarity index 100% rename from components/cldr-json-data-provider/src/download/error.rs rename to components/cldr_json_data_provider/src/download/error.rs diff --git a/components/cldr-json-data-provider/src/download/io_util.rs b/components/cldr_json_data_provider/src/download/io_util.rs similarity index 100% rename from components/cldr-json-data-provider/src/download/io_util.rs rename to components/cldr_json_data_provider/src/download/io_util.rs diff --git a/components/cldr-json-data-provider/src/download/mod.rs b/components/cldr_json_data_provider/src/download/mod.rs similarity index 100% rename from components/cldr-json-data-provider/src/download/mod.rs rename to components/cldr_json_data_provider/src/download/mod.rs diff --git a/components/cldr-json-data-provider/src/error.rs b/components/cldr_json_data_provider/src/error.rs similarity index 100% rename from components/cldr-json-data-provider/src/error.rs rename to components/cldr_json_data_provider/src/error.rs diff --git a/components/cldr-json-data-provider/src/lib.rs b/components/cldr_json_data_provider/src/lib.rs similarity index 93% rename from components/cldr-json-data-provider/src/lib.rs rename to components/cldr_json_data_provider/src/lib.rs index c53e77fbf27..b9d02a0f2cf 100644 --- a/components/cldr-json-data-provider/src/lib.rs +++ b/components/cldr_json_data_provider/src/lib.rs @@ -1,4 +1,4 @@ -//! `icu-cldr-json-data-provider` is one of the [`ICU4X`] components. +//! `icu_cldr_json_data_provider` is one of the [`ICU4X`] components. //! //! It contains implementations of the [`DataProvider`] interface based on the JSON files //! shipped by CLDR. You create a CldrPaths and then pass it into CldrJsonDataProvider. diff --git a/components/cldr-json-data-provider/src/reader.rs b/components/cldr_json_data_provider/src/reader.rs similarity index 100% rename from components/cldr-json-data-provider/src/reader.rs rename to components/cldr_json_data_provider/src/reader.rs diff --git a/components/cldr-json-data-provider/src/support.rs b/components/cldr_json_data_provider/src/support.rs similarity index 100% rename from components/cldr-json-data-provider/src/support.rs rename to components/cldr_json_data_provider/src/support.rs diff --git a/components/cldr-json-data-provider/src/transform/dates.rs b/components/cldr_json_data_provider/src/transform/dates.rs similarity index 100% rename from components/cldr-json-data-provider/src/transform/dates.rs rename to components/cldr_json_data_provider/src/transform/dates.rs diff --git a/components/cldr-json-data-provider/src/transform/mod.rs b/components/cldr_json_data_provider/src/transform/mod.rs similarity index 100% rename from components/cldr-json-data-provider/src/transform/mod.rs rename to components/cldr_json_data_provider/src/transform/mod.rs diff --git a/components/cldr-json-data-provider/src/transform/plurals.rs b/components/cldr_json_data_provider/src/transform/plurals.rs similarity index 99% rename from components/cldr-json-data-provider/src/transform/plurals.rs rename to components/cldr_json_data_provider/src/transform/plurals.rs index 73e39510d1a..47b60248bce 100644 --- a/components/cldr-json-data-provider/src/transform/plurals.rs +++ b/components/cldr_json_data_provider/src/transform/plurals.rs @@ -5,7 +5,7 @@ use crate::CldrPaths; use icu_data_provider::iter::DataEntryCollection; use icu_data_provider::prelude::*; use icu_data_provider::structs::plurals::*; -use icu_pluralrules::rules::{parse, serialize}; +use icu_plurals::rules::{parse, serialize}; use std::borrow::Cow; use std::convert::TryFrom; use std::marker::PhantomData; diff --git a/components/cldr-json-data-provider/tests/testdata/cs-ca-gregorian.json b/components/cldr_json_data_provider/tests/testdata/cs-ca-gregorian.json similarity index 100% rename from components/cldr-json-data-provider/tests/testdata/cs-ca-gregorian.json rename to components/cldr_json_data_provider/tests/testdata/cs-ca-gregorian.json diff --git a/components/cldr-json-data-provider/tests/testdata/dummy.pdf b/components/cldr_json_data_provider/tests/testdata/dummy.pdf similarity index 100% rename from components/cldr-json-data-provider/tests/testdata/dummy.pdf rename to components/cldr_json_data_provider/tests/testdata/dummy.pdf diff --git a/components/cldr-json-data-provider/tests/testdata/dummy.zip b/components/cldr_json_data_provider/tests/testdata/dummy.zip similarity index 100% rename from components/cldr-json-data-provider/tests/testdata/dummy.zip rename to components/cldr_json_data_provider/tests/testdata/dummy.zip diff --git a/components/cldr-json-data-provider/tests/testdata/haw-ca-gregorian.json b/components/cldr_json_data_provider/tests/testdata/haw-ca-gregorian.json similarity index 100% rename from components/cldr-json-data-provider/tests/testdata/haw-ca-gregorian.json rename to components/cldr_json_data_provider/tests/testdata/haw-ca-gregorian.json diff --git a/components/cldr-json-data-provider/tests/testdata/plurals.json b/components/cldr_json_data_provider/tests/testdata/plurals.json similarity index 100% rename from components/cldr-json-data-provider/tests/testdata/plurals.json rename to components/cldr_json_data_provider/tests/testdata/plurals.json diff --git a/components/data-provider/Cargo.toml b/components/data_provider/Cargo.toml similarity index 91% rename from components/data-provider/Cargo.toml rename to components/data_provider/Cargo.toml index 5535b58b9d4..29795610b75 100644 --- a/components/data-provider/Cargo.toml +++ b/components/data_provider/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "icu-data-provider" +name = "icu_data_provider" description = "Trait and struct definitions for the ICU data provider" version = "0.0.1" authors = ["The ICU4X Project Developers"] @@ -19,7 +19,7 @@ include = [ invariant = [] [dependencies] -icu-locale = { path = "../locale" } +icu_locale = { path = "../locale" } tinystr = "0.3" erased-serde = "0.3" smallstr = { version = "0.2", features = ["serde"] } diff --git a/components/data-provider/README.md b/components/data_provider/README.md similarity index 100% rename from components/data-provider/README.md rename to components/data_provider/README.md diff --git a/components/data-provider/src/cloneable_any.rs b/components/data_provider/src/cloneable_any.rs similarity index 100% rename from components/data-provider/src/cloneable_any.rs rename to components/data_provider/src/cloneable_any.rs diff --git a/components/data-provider/src/data_entry.rs b/components/data_provider/src/data_entry.rs similarity index 100% rename from components/data-provider/src/data_entry.rs rename to components/data_provider/src/data_entry.rs diff --git a/components/data-provider/src/data_key.rs b/components/data_provider/src/data_key.rs similarity index 100% rename from components/data-provider/src/data_key.rs rename to components/data_provider/src/data_key.rs diff --git a/components/data-provider/src/data_provider.rs b/components/data_provider/src/data_provider.rs similarity index 100% rename from components/data-provider/src/data_provider.rs rename to components/data_provider/src/data_provider.rs diff --git a/components/data-provider/src/error.rs b/components/data_provider/src/error.rs similarity index 100% rename from components/data-provider/src/error.rs rename to components/data_provider/src/error.rs diff --git a/components/data-provider/src/invariant.rs b/components/data_provider/src/invariant.rs similarity index 100% rename from components/data-provider/src/invariant.rs rename to components/data_provider/src/invariant.rs diff --git a/components/data-provider/src/iter.rs b/components/data_provider/src/iter.rs similarity index 100% rename from components/data-provider/src/iter.rs rename to components/data_provider/src/iter.rs diff --git a/components/data-provider/src/lib.rs b/components/data_provider/src/lib.rs similarity index 98% rename from components/data-provider/src/lib.rs rename to components/data_provider/src/lib.rs index dbf601c7f1a..5d8110d99fa 100644 --- a/components/data-provider/src/lib.rs +++ b/components/data_provider/src/lib.rs @@ -1,4 +1,4 @@ -//! `icu-data-provider` is one of the [`ICU4X`] components. +//! `icu_data_provider` is one of the [`ICU4X`] components. //! //! It defines traits and structs for transmitting data through the ICU4X locale data pipeline. //! The primary trait is [`DataProvider`]. It has one method, which transforms a [`Request`] into diff --git a/components/data-provider/src/structs/dates.rs b/components/data_provider/src/structs/dates.rs similarity index 100% rename from components/data-provider/src/structs/dates.rs rename to components/data_provider/src/structs/dates.rs diff --git a/components/data-provider/src/structs/decimal.rs b/components/data_provider/src/structs/decimal.rs similarity index 100% rename from components/data-provider/src/structs/decimal.rs rename to components/data_provider/src/structs/decimal.rs diff --git a/components/data-provider/src/structs/mod.rs b/components/data_provider/src/structs/mod.rs similarity index 100% rename from components/data-provider/src/structs/mod.rs rename to components/data_provider/src/structs/mod.rs diff --git a/components/data-provider/src/structs/plurals.rs b/components/data_provider/src/structs/plurals.rs similarity index 100% rename from components/data-provider/src/structs/plurals.rs rename to components/data_provider/src/structs/plurals.rs diff --git a/components/data-provider/tests/json_warehouse.rs b/components/data_provider/tests/json_warehouse.rs similarity index 100% rename from components/data-provider/tests/json_warehouse.rs rename to components/data_provider/tests/json_warehouse.rs diff --git a/components/datetime/Cargo.toml b/components/datetime/Cargo.toml index de3d32122e9..f4369ea8156 100644 --- a/components/datetime/Cargo.toml +++ b/components/datetime/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "icu-datetime" +name = "icu_datetime" description = "API for managing Unicode Language and Locale Identifiers" version = "0.0.1" authors = ["The ICU4X Project Developers"] @@ -15,13 +15,13 @@ include = [ ] [dependencies] -icu-locale = { path = "../locale" } -icu-data-provider = { path = "../data-provider" } +icu_locale = { path = "../locale" } +icu_data_provider = { path = "../data_provider" } [dev-dependencies] criterion = "0.3" -icu-data-provider = { path = "../data-provider", features = ["invariant"] } -icu-testdata = { path = "../../resources/testdata" } +icu_data_provider = { path = "../data_provider", features = ["invariant"] } +icu_testdata = { path = "../../resources/testdata" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/components/datetime/src/lib.rs b/components/datetime/src/lib.rs index 74b8f70eda9..25a9e5d4a85 100644 --- a/components/datetime/src/lib.rs +++ b/components/datetime/src/lib.rs @@ -1,4 +1,4 @@ -//! `icu-datetime` is one of the [`ICU4X`] components. +//! `icu_datetime` is one of the [`ICU4X`] components. //! //! It is a core API for formatting date and time to user readable textual representation. //! @@ -64,7 +64,7 @@ use pattern::Pattern; use provider::DateTimeDates; use std::borrow::Cow; -/// `DateTimeFormat` is the main structure of the `icu-datetime` component. +/// `DateTimeFormat` is the main structure of the `icu_datetime` component. /// When constructed, it uses data from the `DataProvider`, selected `LanguageIdentifier` and provided options to /// collect all data necessary to format any dates into that locale. /// diff --git a/components/fs-data-provider/Cargo.toml b/components/fs_data_provider/Cargo.toml similarity index 72% rename from components/fs-data-provider/Cargo.toml rename to components/fs_data_provider/Cargo.toml index b1957dcb62b..1730328cba3 100644 --- a/components/fs-data-provider/Cargo.toml +++ b/components/fs_data_provider/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "icu-fs-data-provider" +name = "icu_fs_data_provider" description = "ICU4X data provider that reads from structured data files" version = "0.0.1" authors = ["The ICU4X Project Developers"] @@ -15,8 +15,8 @@ include = [ ] [dependencies] -icu-data-provider = { path = "../data-provider" } -icu-locale = { path = "../locale", features = ["serde"] } +icu_data_provider = { path = "../data_provider" } +icu_locale = { path = "../locale", features = ["serde"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -26,12 +26,12 @@ log = { version = "0.4", optional = true } # Dependencies for the binary clap = { version = "2.33", optional = true } -icu-cldr-json-data-provider = { path = "../cldr-json-data-provider", features = ["download"], optional = true } +icu_cldr_json_data_provider = { path = "../cldr_json_data_provider", features = ["download"], optional = true } simple_logger = { version = "1.10", optional = true } [features] -export = ["erased-serde", "icu-data-provider/invariant", "log"] -export-bin = ["export", "clap", "icu-cldr-json-data-provider", "simple_logger"] +export = ["erased-serde", "icu_data_provider/invariant", "log"] +export-bin = ["export", "clap", "icu_cldr_json_data_provider", "simple_logger"] [[bin]] name = "icu4x-cldr-export" diff --git a/components/fs-data-provider/README.md b/components/fs_data_provider/README.md similarity index 100% rename from components/fs-data-provider/README.md rename to components/fs_data_provider/README.md diff --git a/components/fs-data-provider/src/bin/icu4x-cldr-export.rs b/components/fs_data_provider/src/bin/icu4x-cldr-export.rs similarity index 100% rename from components/fs-data-provider/src/bin/icu4x-cldr-export.rs rename to components/fs_data_provider/src/bin/icu4x-cldr-export.rs diff --git a/components/fs-data-provider/src/error.rs b/components/fs_data_provider/src/error.rs similarity index 100% rename from components/fs-data-provider/src/error.rs rename to components/fs_data_provider/src/error.rs diff --git a/components/fs-data-provider/src/export/aliasing.rs b/components/fs_data_provider/src/export/aliasing.rs similarity index 100% rename from components/fs-data-provider/src/export/aliasing.rs rename to components/fs_data_provider/src/export/aliasing.rs diff --git a/components/fs-data-provider/src/export/fs_exporter.rs b/components/fs_data_provider/src/export/fs_exporter.rs similarity index 100% rename from components/fs-data-provider/src/export/fs_exporter.rs rename to components/fs_data_provider/src/export/fs_exporter.rs diff --git a/components/fs-data-provider/src/export/mod.rs b/components/fs_data_provider/src/export/mod.rs similarity index 100% rename from components/fs-data-provider/src/export/mod.rs rename to components/fs_data_provider/src/export/mod.rs diff --git a/components/fs-data-provider/src/export/serializers.rs b/components/fs_data_provider/src/export/serializers.rs similarity index 100% rename from components/fs-data-provider/src/export/serializers.rs rename to components/fs_data_provider/src/export/serializers.rs diff --git a/components/fs-data-provider/src/fs_data_provider.rs b/components/fs_data_provider/src/fs_data_provider.rs similarity index 100% rename from components/fs-data-provider/src/fs_data_provider.rs rename to components/fs_data_provider/src/fs_data_provider.rs diff --git a/components/fs-data-provider/src/lib.rs b/components/fs_data_provider/src/lib.rs similarity index 90% rename from components/fs-data-provider/src/lib.rs rename to components/fs_data_provider/src/lib.rs index becc61bc5e7..b8e14f69924 100644 --- a/components/fs-data-provider/src/lib.rs +++ b/components/fs_data_provider/src/lib.rs @@ -1,4 +1,4 @@ -//! `icu-fs-data-provider` is one of the [`ICU4X`] components. +//! `icu_fs_data_provider` is one of the [`ICU4X`] components. //! //! It reads ICU4X data files from the filesystem in a given directory. It can also export data to //! the filesystem via an iterable data provider (see the `export` module). diff --git a/components/fs-data-provider/src/manifest.rs b/components/fs_data_provider/src/manifest.rs similarity index 100% rename from components/fs-data-provider/src/manifest.rs rename to components/fs_data_provider/src/manifest.rs diff --git a/components/fs-data-provider/tests/test_file_io.rs b/components/fs_data_provider/tests/test_file_io.rs similarity index 100% rename from components/fs-data-provider/tests/test_file_io.rs rename to components/fs_data_provider/tests/test_file_io.rs diff --git a/components/icu/Cargo.toml b/components/icu/Cargo.toml index e258e9f55d9..c95f0b2cc7b 100644 --- a/components/icu/Cargo.toml +++ b/components/icu/Cargo.toml @@ -15,10 +15,10 @@ include = [ ] [dependencies] -icu-datetime = { path = "../datetime" } -icu-locale = { path = "../locale" } -icu-pluralrules = { path = "../pluralrules" } -icu-unicodeset = { path = "../uniset" } +icu_datetime = { path = "../datetime" } +icu_locale = { path = "../locale" } +icu_plurals = { path = "../plurals" } +icu_uniset = { path = "../uniset" } [dev-dependencies] -icu-testdata = { path = "../../resources/testdata" } +icu_testdata = { path = "../../resources/testdata" } diff --git a/components/icu/src/lib.rs b/components/icu/src/lib.rs index 248d0f78cee..43c39c494a6 100644 --- a/components/icu/src/lib.rs +++ b/components/icu/src/lib.rs @@ -62,6 +62,6 @@ pub use icu_datetime as datetime; #[doc(inline)] pub use icu_locale as locale; #[doc(inline)] -pub use icu_pluralrules as plurals; +pub use icu_plurals as plurals; #[doc(inline)] -pub use icu_unicodeset as uniset; +pub use icu_uniset as uniset; diff --git a/components/locale/Cargo.toml b/components/locale/Cargo.toml index c4c0908ca1f..40f438c998c 100644 --- a/components/locale/Cargo.toml +++ b/components/locale/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "icu-locale" +name = "icu_locale" description = "API for managing Unicode Language and Locale Identifiers" version = "0.0.1" authors = ["The ICU4X Project Developers"] diff --git a/components/locale/README.md b/components/locale/README.md index 0c957c06119..7e4f668b455 100644 --- a/components/locale/README.md +++ b/components/locale/README.md @@ -2,7 +2,7 @@ ICU4X is a set of internationalization components for Unicode. -# Status [![crates.io](http://meritbadge.herokuapp.com/icu-locale)](https://crates.io/crates/icu-locale) +# Status [![crates.io](http://meritbadge.herokuapp.com/icu_locale)](https://crates.io/crates/icu_locale) The project is in an incubation period. diff --git a/components/locale/macros/Cargo.toml b/components/locale/macros/Cargo.toml index bcf6c1b5d04..6cbe9a83704 100644 --- a/components/locale/macros/Cargo.toml +++ b/components/locale/macros/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "icu-locale-macros" -description = "proc-macros for icu-locale" +name = "icu_locale_macros" +description = "proc-macros for icu_locale" version = "0.0.1" authors = ["The ICU4X Project Developers"] edition = "2018" @@ -18,5 +18,5 @@ include = [ proc_macro = true [dependencies] -icu-locale = { version = "0.0.1", path = "../" } +icu_locale = { version = "0.0.1", path = "../" } tinystr = "0.3" diff --git a/components/locale/src/lib.rs b/components/locale/src/lib.rs index 59526f68b80..12233637a0d 100644 --- a/components/locale/src/lib.rs +++ b/components/locale/src/lib.rs @@ -1,4 +1,4 @@ -//! `icu-locale` is one of the [`ICU4X`] components. +//! `icu_locale` is one of the [`ICU4X`] components. //! //! It is a core API for parsing, manipulating, and serializing Unicode Language //! and Locale Identifiers. diff --git a/components/pluralrules/Cargo.toml b/components/plurals/Cargo.toml similarity index 66% rename from components/pluralrules/Cargo.toml rename to components/plurals/Cargo.toml index 93e22ae8501..12a1b54fdb8 100644 --- a/components/pluralrules/Cargo.toml +++ b/components/plurals/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "icu-pluralrules" +name = "icu_plurals" description = "Unicode Plural Rules categorizer for numeric input." version = "0.0.1" authors = ["The ICU4X Project Developers"] @@ -15,17 +15,17 @@ include = [ ] [dependencies] -icu-locale = { path = "../locale" } -icu-data-provider = { path = "../data-provider" } -fixed-decimal = { path = "../../utils/fixed-decimal" } +icu_locale = { path = "../locale" } +icu_data_provider = { path = "../data_provider" } +fixed_decimal = { path = "../../utils/fixed_decimal" } [dev-dependencies] criterion = "0.3" serde = { version = "1.0", features = ["derive"] } serde_json = {version = "1.0" } -icu-locale = { path = "../locale", features = ["serde"] } -icu-data-provider = { path = "../data-provider", features = ["invariant"] } -icu-testdata = { path = "../../resources/testdata" } +icu_locale = { path = "../locale", features = ["serde"] } +icu_data_provider = { path = "../data_provider", features = ["invariant"] } +icu_testdata = { path = "../../resources/testdata" } [features] default = [] diff --git a/components/pluralrules/benches/fixtures/mod.rs b/components/plurals/benches/fixtures/mod.rs similarity index 97% rename from components/pluralrules/benches/fixtures/mod.rs rename to components/plurals/benches/fixtures/mod.rs index 52e7a78cd6f..f6008c774e9 100644 --- a/components/pluralrules/benches/fixtures/mod.rs +++ b/components/plurals/benches/fixtures/mod.rs @@ -1,5 +1,5 @@ use icu_locale::LanguageIdentifier; -use icu_pluralrules::PluralCategory; +use icu_plurals::PluralCategory; use serde::Deserialize; diff --git a/components/pluralrules/benches/fixtures/numbers.json b/components/plurals/benches/fixtures/numbers.json similarity index 100% rename from components/pluralrules/benches/fixtures/numbers.json rename to components/plurals/benches/fixtures/numbers.json diff --git a/components/pluralrules/benches/fixtures/plurals.json b/components/plurals/benches/fixtures/plurals.json similarity index 100% rename from components/pluralrules/benches/fixtures/plurals.json rename to components/plurals/benches/fixtures/plurals.json diff --git a/components/pluralrules/benches/helpers/mod.rs b/components/plurals/benches/helpers/mod.rs similarity index 100% rename from components/pluralrules/benches/helpers/mod.rs rename to components/plurals/benches/helpers/mod.rs diff --git a/components/pluralrules/benches/operands.rs b/components/plurals/benches/operands.rs similarity index 99% rename from components/pluralrules/benches/operands.rs rename to components/plurals/benches/operands.rs index 3d603db4580..83f514464d3 100644 --- a/components/pluralrules/benches/operands.rs +++ b/components/plurals/benches/operands.rs @@ -3,7 +3,7 @@ mod helpers; use criterion::{black_box, criterion_group, criterion_main, Criterion}; use fixed_decimal::FixedDecimal; -use icu_pluralrules::PluralOperands; +use icu_plurals::PluralOperands; use std::convert::TryInto; fn operands(c: &mut Criterion) { diff --git a/components/pluralrules/benches/parser.rs b/components/plurals/benches/parser.rs similarity index 94% rename from components/pluralrules/benches/parser.rs rename to components/plurals/benches/parser.rs index 0ed9a02e949..14a1c14e67f 100644 --- a/components/pluralrules/benches/parser.rs +++ b/components/plurals/benches/parser.rs @@ -7,7 +7,7 @@ use icu_data_provider::{icu_data_key, structs, DataEntry, DataProvider, DataRequ use std::borrow::Cow; fn parser(c: &mut Criterion) { - use icu_pluralrules::rules::parse_condition; + use icu_plurals::rules::parse_condition; let plurals_data = helpers::get_plurals_data(); @@ -53,7 +53,7 @@ fn parser(c: &mut Criterion) { #[cfg(feature = "bench")] c.bench_function("parser/lex", |b| { - use icu_pluralrules::rules::Lexer; + use icu_plurals::rules::Lexer; b.iter(|| { for rule in &rules { let _ = Lexer::new(black_box(rule.as_bytes())).count(); diff --git a/components/pluralrules/benches/pluralrules.rs b/components/plurals/benches/pluralrules.rs similarity index 96% rename from components/pluralrules/benches/pluralrules.rs rename to components/plurals/benches/pluralrules.rs index e85ed2b790f..8c2ff855b45 100644 --- a/components/pluralrules/benches/pluralrules.rs +++ b/components/plurals/benches/pluralrules.rs @@ -3,7 +3,7 @@ mod helpers; use criterion::{criterion_group, criterion_main, Criterion}; -use icu_pluralrules::{PluralRuleType, PluralRules}; +use icu_plurals::{PluralRuleType, PluralRules}; fn pluralrules(c: &mut Criterion) { let plurals_data = helpers::get_plurals_data(); diff --git a/components/pluralrules/examples/elevator_floors.rs b/components/plurals/examples/elevator_floors.rs similarity index 89% rename from components/pluralrules/examples/elevator_floors.rs rename to components/plurals/examples/elevator_floors.rs index a9cf340a4ca..3ddda98961d 100644 --- a/components/pluralrules/examples/elevator_floors.rs +++ b/components/plurals/examples/elevator_floors.rs @@ -1,7 +1,7 @@ -// An example application which uses icu_pluralrules to construct a correct +// An example application which uses icu_plurals to construct a correct // sentence for English based on the numerical value in Ordinal category. use icu_locale::LanguageIdentifier; -use icu_pluralrules::{PluralCategory, PluralRuleType, PluralRules}; +use icu_plurals::{PluralCategory, PluralRuleType, PluralRules}; const VALUES: &[usize] = &[0, 2, 25, 1, 3, 2, 4, 10, 7, 0]; diff --git a/components/pluralrules/examples/unread_emails.rs b/components/plurals/examples/unread_emails.rs similarity index 87% rename from components/pluralrules/examples/unread_emails.rs rename to components/plurals/examples/unread_emails.rs index e048aab4a27..387fd05c266 100644 --- a/components/pluralrules/examples/unread_emails.rs +++ b/components/plurals/examples/unread_emails.rs @@ -1,7 +1,7 @@ -// An example application which uses icu_pluralrules to construct a correct +// An example application which uses icu_plurals to construct a correct // sentence for English based on the numerical value in Cardinal category. use icu_locale::LanguageIdentifier; -use icu_pluralrules::{PluralCategory, PluralRuleType, PluralRules}; +use icu_plurals::{PluralCategory, PluralRuleType, PluralRules}; const VALUES: &[usize] = &[0, 2, 25, 1, 3, 2, 4, 10, 7, 0]; diff --git a/components/pluralrules/src/data.rs b/components/plurals/src/data.rs similarity index 97% rename from components/pluralrules/src/data.rs rename to components/plurals/src/data.rs index ac7edbef5f2..5fab888d59c 100644 --- a/components/pluralrules/src/data.rs +++ b/components/plurals/src/data.rs @@ -4,8 +4,8 @@ //! //! ``` //! use icu_locale::LanguageIdentifier; -//! use icu_pluralrules::{PluralCategory, PluralRuleType, PluralOperands}; -//! use icu_pluralrules::data::{PluralRuleList, RulesSelector}; +//! use icu_plurals::{PluralCategory, PluralRuleType, PluralOperands}; +//! use icu_plurals::data::{PluralRuleList, RulesSelector}; //! use icu_data_provider::prelude::*; //! use icu_data_provider::{InvariantDataProvider, structs}; //! use std::borrow::Cow; diff --git a/components/pluralrules/src/error.rs b/components/plurals/src/error.rs similarity index 100% rename from components/pluralrules/src/error.rs rename to components/plurals/src/error.rs diff --git a/components/pluralrules/src/lib.rs b/components/plurals/src/lib.rs similarity index 95% rename from components/pluralrules/src/lib.rs rename to components/plurals/src/lib.rs index e90218f0ce1..3ecd184d725 100644 --- a/components/pluralrules/src/lib.rs +++ b/components/plurals/src/lib.rs @@ -1,4 +1,4 @@ -//! `icu-pluralrules` is one of the [`ICU4X`] components. +//! `icu_plurals` is one of the [`ICU4X`] components. //! //! This API provides functionality to determine the plural category //! appropriate for a given number in a given language. @@ -21,7 +21,7 @@ //! //! ``` //! use icu_locale::LanguageIdentifier; -//! use icu_pluralrules::{PluralRules, PluralRuleType, PluralCategory}; +//! use icu_plurals::{PluralRules, PluralRuleType, PluralCategory}; //! use icu_data_provider::InvariantDataProvider; //! //! let lang: LanguageIdentifier = "en".parse() @@ -131,7 +131,7 @@ pub enum PluralRuleType { /// /// ``` /// use icu_locale::LanguageIdentifier; -/// use icu_pluralrules::{PluralRules, PluralRuleType, PluralCategory}; +/// use icu_plurals::{PluralRules, PluralRuleType, PluralCategory}; /// use icu_data_provider::InvariantDataProvider; /// /// let lang: LanguageIdentifier = "en".parse() @@ -207,7 +207,7 @@ impl PluralCategory { /// # Examples /// /// ``` - /// use icu_pluralrules::PluralCategory; + /// use icu_plurals::PluralCategory; /// /// let mut categories = PluralCategory::all(); /// @@ -239,7 +239,7 @@ impl PluralCategory { /// /// ``` /// use icu_locale::LanguageIdentifier; -/// use icu_pluralrules::{PluralRules, PluralRuleType, PluralCategory}; +/// use icu_plurals::{PluralRules, PluralRuleType, PluralCategory}; /// use icu_data_provider::InvariantDataProvider; /// /// let lang: LanguageIdentifier = "en".parse() @@ -271,7 +271,7 @@ impl PluralRules { /// /// ``` /// use icu_locale::LanguageIdentifier; - /// use icu_pluralrules::{PluralRules, PluralRuleType}; + /// use icu_plurals::{PluralRules, PluralRuleType}; /// use icu_data_provider::InvariantDataProvider; /// /// let lang: LanguageIdentifier = "en".parse() @@ -316,7 +316,7 @@ impl PluralRules { /// /// ``` /// use icu_locale::LanguageIdentifier; - /// use icu_pluralrules::{PluralRules, PluralRuleType, PluralCategory}; + /// use icu_plurals::{PluralRules, PluralRuleType, PluralCategory}; /// use icu_data_provider::InvariantDataProvider; /// /// let lang: LanguageIdentifier = "en".parse() @@ -346,8 +346,8 @@ impl PluralRules { /// ``` /// # use std::convert::TryFrom; /// # use icu_locale::LanguageIdentifier; - /// # use icu_pluralrules::{PluralRules, PluralRuleType}; - /// use icu_pluralrules::{PluralCategory, PluralOperands}; + /// # use icu_plurals::{PluralRules, PluralRuleType}; + /// use icu_plurals::{PluralCategory, PluralOperands}; /// # use icu_data_provider::InvariantDataProvider; /// # /// # let lang: LanguageIdentifier = "en".parse() diff --git a/components/pluralrules/src/operands.rs b/components/plurals/src/operands.rs similarity index 98% rename from components/pluralrules/src/operands.rs rename to components/plurals/src/operands.rs index 00dbfee8ca7..06fd4e2dd53 100644 --- a/components/pluralrules/src/operands.rs +++ b/components/plurals/src/operands.rs @@ -15,7 +15,7 @@ use std::str::FromStr; /// From int /// /// ``` -/// use icu_pluralrules::PluralOperands; +/// use icu_plurals::PluralOperands; /// assert_eq!(PluralOperands { /// i: 2, /// v: 0, @@ -29,7 +29,7 @@ use std::str::FromStr; /// /// ``` /// use std::str::FromStr; -/// use icu_pluralrules::PluralOperands; +/// use icu_plurals::PluralOperands; /// assert_eq!(Ok(PluralOperands { /// i: 1234, /// v: 3, @@ -43,7 +43,7 @@ use std::str::FromStr; /// /// ``` /// use std::convert::TryFrom; -/// use icu_pluralrules::PluralOperands; +/// use icu_plurals::PluralOperands; /// assert_eq!(Ok(PluralOperands { /// i: 123, /// v: 2, diff --git a/components/pluralrules/src/rules/ast.rs b/components/plurals/src/rules/ast.rs similarity index 93% rename from components/pluralrules/src/rules/ast.rs rename to components/plurals/src/rules/ast.rs index 62279dcac13..018129ffaa3 100644 --- a/components/pluralrules/src/rules/ast.rs +++ b/components/plurals/src/rules/ast.rs @@ -5,8 +5,8 @@ //! # Examples //! //! ``` -//! use icu_pluralrules::rules::parse_condition; -//! use icu_pluralrules::rules::ast::*; +//! use icu_plurals::rules::parse_condition; +//! use icu_plurals::rules::ast::*; //! //! let input = "i = 1"; //! @@ -42,8 +42,8 @@ use std::ops::RangeInclusive; /// # Examples /// /// ``` -/// use icu_pluralrules::rules::ast::*; -/// use icu_pluralrules::rules::{parse, parse_condition}; +/// use icu_plurals::rules::ast::*; +/// use icu_plurals::rules::{parse, parse_condition}; /// /// let condition = parse_condition(b"i = 5 or v = 2") /// .expect("Parsing failed."); @@ -87,8 +87,8 @@ pub struct Rule { /// # Examples /// /// ``` -/// use icu_pluralrules::rules::ast::*; -/// use icu_pluralrules::rules::parse_condition; +/// use icu_plurals::rules::ast::*; +/// use icu_plurals::rules::parse_condition; /// /// let condition = Condition(Box::new([ /// AndCondition(Box::new([Relation { @@ -131,7 +131,7 @@ pub struct Condition(pub Box<[AndCondition]>); /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// AndCondition(Box::new([ /// Relation { @@ -169,7 +169,7 @@ pub struct AndCondition(pub Box<[Relation]>); /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// Relation { /// expression: Expression { @@ -216,7 +216,7 @@ pub enum Operator { /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// Expression { /// operand: Operand::I, @@ -243,7 +243,7 @@ pub struct Expression { /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::Operand; +/// use icu_plurals::rules::ast::Operand; /// /// Operand::I; /// ``` @@ -276,7 +276,7 @@ pub enum Operand { /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// RangeList(Box::new([ /// RangeListItem::Value(Value(5)), @@ -302,7 +302,7 @@ pub struct RangeList(pub Box<[RangeListItem]>); /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// let _ = RangeListItem::Value(Value(5)); /// let _ = RangeListItem::Range(Value(11)..=Value(15)); @@ -326,7 +326,7 @@ pub enum RangeListItem { /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// RangeListItem::Value(Value(99)); /// ``` @@ -342,7 +342,7 @@ pub struct Value(pub u64); /// ``` /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// Samples { /// integer: Some(SampleList { /// sample_ranges: Box::new([SampleRange { @@ -375,7 +375,7 @@ pub struct Samples { /// ``` /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// SampleList { /// sample_ranges: Box::new([ /// SampleRange { @@ -401,7 +401,7 @@ pub struct SampleList { /// ``` /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// SampleRange { /// lower_val: DecimalValue("0.0".to_string()), /// upper_val: Some(DecimalValue("1.5".to_string())), @@ -422,7 +422,7 @@ pub struct SampleRange { /// ``` /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// DecimalValue("1.00".to_string()); /// ``` #[derive(Debug, Clone, PartialEq)] diff --git a/components/pluralrules/src/rules/lexer.rs b/components/plurals/src/rules/lexer.rs similarity index 98% rename from components/pluralrules/src/rules/lexer.rs rename to components/plurals/src/rules/lexer.rs index f032d7576dd..11406b45c7e 100644 --- a/components/pluralrules/src/rules/lexer.rs +++ b/components/plurals/src/rules/lexer.rs @@ -32,7 +32,7 @@ pub enum LexerError { /// # Examples /// /// ``` -/// use icu_pluralrules::rules::Lexer; +/// use icu_plurals::rules::Lexer; /// /// let input = b"i = 5"; /// let lexer = Lexer::new(input); @@ -49,7 +49,7 @@ impl<'l> Lexer<'l> { /// # Examples /// /// ``` - /// use icu_pluralrules::rules::Lexer; + /// use icu_plurals::rules::Lexer; /// /// Lexer::new(b"n = 1"); /// ``` diff --git a/components/pluralrules/src/rules/mod.rs b/components/plurals/src/rules/mod.rs similarity index 95% rename from components/pluralrules/src/rules/mod.rs rename to components/plurals/src/rules/mod.rs index 327a065c20f..3e02bcfbdc4 100644 --- a/components/pluralrules/src/rules/mod.rs +++ b/components/plurals/src/rules/mod.rs @@ -24,7 +24,7 @@ //! That value expanded into [`PluralOperands`] looks like this: //! //! ``` -//! use icu_pluralrules::PluralOperands; +//! use icu_plurals::PluralOperands; //! PluralOperands { //! i: 1, //! v: 0, @@ -48,8 +48,8 @@ //! When parsed, the resulting [`AST`] will look like this: //! //! ``` -//! use icu_pluralrules::rules::parse_condition; -//! use icu_pluralrules::rules::ast::*; +//! use icu_plurals::rules::parse_condition; +//! use icu_plurals::rules::ast::*; //! //! let input = "i = 1 and v = 0 @integer 1"; //! @@ -90,8 +90,8 @@ //! matches: //! //! ``` -//! use icu_pluralrules::rules::{test_condition, parse_condition}; -//! use icu_pluralrules::PluralOperands; +//! use icu_plurals::rules::{test_condition, parse_condition}; +//! use icu_plurals::PluralOperands; //! //! let input = "i = 1 and v = 0 @integer 1"; //! diff --git a/components/pluralrules/src/rules/parser.rs b/components/plurals/src/rules/parser.rs similarity index 99% rename from components/pluralrules/src/rules/parser.rs rename to components/plurals/src/rules/parser.rs index ad32a4e8d45..716c7c5aea7 100644 --- a/components/pluralrules/src/rules/parser.rs +++ b/components/plurals/src/rules/parser.rs @@ -29,7 +29,7 @@ pub enum ParserError { /// # Examples /// /// ``` -/// use icu_pluralrules::rules::parse; +/// use icu_plurals::rules::parse; /// /// let input = b"i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04"; /// assert_eq!(parse(input).is_ok(), true); @@ -57,7 +57,7 @@ pub fn parse(input: &[u8]) -> Result { /// # Examples /// /// ``` -/// use icu_pluralrules::rules::parse_condition; +/// use icu_plurals::rules::parse_condition; /// /// let input = b"i = 0 or n = 1"; /// assert_eq!(parse_condition(input).is_ok(), true); diff --git a/components/pluralrules/src/rules/resolver.rs b/components/plurals/src/rules/resolver.rs similarity index 96% rename from components/pluralrules/src/rules/resolver.rs rename to components/plurals/src/rules/resolver.rs index 1bbff54d0d5..a26f95f75a9 100644 --- a/components/pluralrules/src/rules/resolver.rs +++ b/components/plurals/src/rules/resolver.rs @@ -7,8 +7,8 @@ use crate::operands::PluralOperands; /// # Examples /// /// ``` -/// use icu_pluralrules::PluralOperands; -/// use icu_pluralrules::rules::{parse_condition, test_condition}; +/// use icu_plurals::PluralOperands; +/// use icu_plurals::rules::{parse_condition, test_condition}; /// /// let operands = PluralOperands::from(5_usize); /// let condition = parse_condition(b"i = 4..6") diff --git a/components/pluralrules/src/rules/serializer.rs b/components/plurals/src/rules/serializer.rs similarity index 97% rename from components/pluralrules/src/rules/serializer.rs rename to components/plurals/src/rules/serializer.rs index 5b7b4eba98d..f44554ab74d 100644 --- a/components/pluralrules/src/rules/serializer.rs +++ b/components/plurals/src/rules/serializer.rs @@ -7,9 +7,9 @@ use std::ops::RangeInclusive; /// # Examples /// /// ``` -/// use icu_pluralrules::rules::parse; -/// use icu_pluralrules::rules::ast; -/// use icu_pluralrules::rules::serialize; +/// use icu_plurals::rules::parse; +/// use icu_plurals::rules::ast; +/// use icu_plurals::rules::serialize; /// /// let input = "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04"; /// diff --git a/components/pluralrules/tests/fixtures/mod.rs b/components/plurals/tests/fixtures/mod.rs similarity index 98% rename from components/pluralrules/tests/fixtures/mod.rs rename to components/plurals/tests/fixtures/mod.rs index d419f94a70a..c2095c43610 100644 --- a/components/pluralrules/tests/fixtures/mod.rs +++ b/components/plurals/tests/fixtures/mod.rs @@ -1,5 +1,5 @@ use fixed_decimal::FixedDecimal; -use icu_pluralrules::PluralOperands; +use icu_plurals::PluralOperands; use serde::Deserialize; use std::convert::TryInto; diff --git a/components/pluralrules/tests/fixtures/operands.json b/components/plurals/tests/fixtures/operands.json similarity index 100% rename from components/pluralrules/tests/fixtures/operands.json rename to components/plurals/tests/fixtures/operands.json diff --git a/components/pluralrules/tests/fixtures/rules.json b/components/plurals/tests/fixtures/rules.json similarity index 100% rename from components/pluralrules/tests/fixtures/rules.json rename to components/plurals/tests/fixtures/rules.json diff --git a/components/pluralrules/tests/helpers.rs b/components/plurals/tests/helpers.rs similarity index 100% rename from components/pluralrules/tests/helpers.rs rename to components/plurals/tests/helpers.rs diff --git a/components/pluralrules/tests/operands.rs b/components/plurals/tests/operands.rs similarity index 98% rename from components/pluralrules/tests/operands.rs rename to components/plurals/tests/operands.rs index 850ce91f2b3..5ed4f6092bf 100644 --- a/components/pluralrules/tests/operands.rs +++ b/components/plurals/tests/operands.rs @@ -4,7 +4,7 @@ mod helpers; use std::convert::TryInto; use fixed_decimal::FixedDecimal; -use icu_pluralrules::PluralOperands; +use icu_plurals::PluralOperands; #[test] fn test_parsing_operands() { diff --git a/components/pluralrules/tests/plurals.rs b/components/plurals/tests/plurals.rs similarity index 91% rename from components/pluralrules/tests/plurals.rs rename to components/plurals/tests/plurals.rs index 4be5ad0f424..b3069acb396 100644 --- a/components/pluralrules/tests/plurals.rs +++ b/components/plurals/tests/plurals.rs @@ -1,5 +1,5 @@ use icu_locale::LanguageIdentifier; -use icu_pluralrules::{PluralCategory, PluralRuleType, PluralRules}; +use icu_plurals::{PluralCategory, PluralRuleType, PluralRules}; #[test] fn test_plural_rules() { diff --git a/components/pluralrules/tests/rules.rs b/components/plurals/tests/rules.rs similarity index 89% rename from components/pluralrules/tests/rules.rs rename to components/plurals/tests/rules.rs index 29246531664..f5364d7ca3c 100644 --- a/components/pluralrules/tests/rules.rs +++ b/components/plurals/tests/rules.rs @@ -1,8 +1,8 @@ mod fixtures; mod helpers; -use icu_pluralrules::rules::{parse, parse_condition, test_condition, Lexer}; -use icu_pluralrules::PluralOperands; +use icu_plurals::rules::{parse, parse_condition, test_condition, Lexer}; +use icu_plurals::PluralOperands; #[test] fn test_parsing_operands() { diff --git a/components/uniset/Cargo.toml b/components/uniset/Cargo.toml index a08f608ac87..26ec635aaaa 100644 --- a/components/uniset/Cargo.toml +++ b/components/uniset/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "icu-unicodeset" +name = "icu_uniset" description = "API for managing Unicode Language and Locale Identifiers" version = "0.0.1" authors = ["The ICU4X Project Developers"] @@ -21,4 +21,4 @@ bench = false [[bench]] name = "inv_list" -harness = false \ No newline at end of file +harness = false diff --git a/components/uniset/benches/inv_list.rs b/components/uniset/benches/inv_list.rs index 31dacb530ee..92fe2cce314 100644 --- a/components/uniset/benches/inv_list.rs +++ b/components/uniset/benches/inv_list.rs @@ -1,5 +1,5 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use icu_unicodeset::UnicodeSet; +use icu_uniset::UnicodeSet; use std::char; fn contains_bench(c: &mut Criterion) { diff --git a/components/uniset/examples/unicode_bmp_blocks_selector.rs b/components/uniset/examples/unicode_bmp_blocks_selector.rs index f52e85980e8..18009945049 100644 --- a/components/uniset/examples/unicode_bmp_blocks_selector.rs +++ b/components/uniset/examples/unicode_bmp_blocks_selector.rs @@ -7,7 +7,7 @@ // // This is a simple example of the API use and is severely oversimplified // compared to real Unicode block selection. -use icu_unicodeset::{UnicodeSet, UnicodeSetBuilder}; +use icu_uniset::{UnicodeSet, UnicodeSetBuilder}; fn get_basic_latin_block() -> UnicodeSet { let mut builder = UnicodeSetBuilder::new(); diff --git a/components/uniset/src/builder.rs b/components/uniset/src/builder.rs index cba2dca06e1..06f092ce835 100644 --- a/components/uniset/src/builder.rs +++ b/components/uniset/src/builder.rs @@ -77,7 +77,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_char('a'); /// let check = builder.build(); @@ -93,7 +93,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='Z')); /// let check = builder.build(); @@ -109,7 +109,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::{UnicodeSet, UnicodeSetBuilder}; + /// use icu_uniset::{UnicodeSet, UnicodeSetBuilder}; /// let mut builder = UnicodeSetBuilder::new(); /// let set = UnicodeSet::from_inversion_list(vec![65, 76]).unwrap(); /// builder.add_set(&set); @@ -144,7 +144,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='Z')); /// builder.remove_char('A'); @@ -160,7 +160,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='Z')); /// builder.remove_range(&('A'..='C')); @@ -176,7 +176,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::{UnicodeSet, UnicodeSetBuilder}; + /// use icu_uniset::{UnicodeSet, UnicodeSetBuilder}; /// let mut builder = UnicodeSetBuilder::new(); /// let set = UnicodeSet::from_inversion_list(vec![65, 70]).unwrap(); /// builder.add_range(&('A'..='Z')); @@ -194,7 +194,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='Z')); /// builder.retain_char('A'); @@ -214,7 +214,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='Z')); /// builder.retain_range(&('A'..='B')); @@ -235,7 +235,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::{UnicodeSetBuilder, UnicodeSet}; + /// use icu_uniset::{UnicodeSetBuilder, UnicodeSet}; /// let mut builder = UnicodeSetBuilder::new(); /// let set = UnicodeSet::from_inversion_list(vec![65, 70]).unwrap(); /// builder.add_range(&('A'..='Z')); @@ -297,7 +297,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::{UnicodeSetBuilder, UnicodeSet}; + /// use icu_uniset::{UnicodeSetBuilder, UnicodeSet}; /// let mut builder = UnicodeSetBuilder::new(); /// let set = UnicodeSet::from_inversion_list(vec![0, 65, 70, (std::char::MAX as u32) + 1]).unwrap(); /// builder.add_set(&set); @@ -325,7 +325,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='D')); /// builder.complement_char('A'); @@ -346,7 +346,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='D')); /// builder.complement_range(&('C'..='F')); @@ -366,7 +366,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::{UnicodeSetBuilder, UnicodeSet}; + /// use icu_uniset::{UnicodeSetBuilder, UnicodeSet}; /// let mut builder = UnicodeSetBuilder::new(); /// let set = UnicodeSet::from_inversion_list(vec![65, 70, 75, 90]).unwrap(); /// builder.add_range(&('C'..='N')); // 67 - 78 diff --git a/components/uniset/src/lib.rs b/components/uniset/src/lib.rs index 762ecde5723..dae9358e41d 100644 --- a/components/uniset/src/lib.rs +++ b/components/uniset/src/lib.rs @@ -18,12 +18,12 @@ //! the [`UnicodeSetBuilder`](struct.UnicodeSetBuilder.html), or from the TBA Properties API. //! //! ``` -//! use icu_unicodeset::UnicodeSet; +//! use icu_uniset::UnicodeSet; //! let inv_list = vec![65, 70]; // 'A'..'F' //! let set = UnicodeSet::from_inversion_list(inv_list); //! assert!(set.is_ok()); //! -//! use icu_unicodeset::UnicodeSetBuilder; +//! use icu_uniset::UnicodeSetBuilder; //! let mut builder = UnicodeSetBuilder::new(); //! builder.add_range(&('A'..'Z')); //! let set: UnicodeSet = builder.build(); @@ -35,7 +35,7 @@ //! Currently, you can check if a character/range of characters exists in the UnicodeSet, or iterate through the characters. //! //! ``` -//! use icu_unicodeset::UnicodeSet; +//! use icu_uniset::UnicodeSet; //! let inv_list = vec![65, 70]; // 'A'..'F' //! let set = UnicodeSet::from_inversion_list(inv_list).unwrap(); //! assert!(set.contains('A')); diff --git a/components/uniset/src/uniset.rs b/components/uniset/src/uniset.rs index 89b45eaa894..41fe30ede5d 100644 --- a/components/uniset/src/uniset.rs +++ b/components/uniset/src/uniset.rs @@ -30,8 +30,8 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; - /// use icu_unicodeset::UnicodeSetError; + /// use icu_uniset::UnicodeSet; + /// use icu_uniset::UnicodeSetError; /// let empty: Vec = vec![]; /// assert_eq!(UnicodeSet::from_inversion_list(empty.clone()), Err(UnicodeSetError::InvalidSet(empty.clone()))) /// ``` @@ -79,7 +79,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 68, 69, 70]; /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// let mut example_iter = example.iter(); @@ -140,7 +140,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 67, 68, 69]; /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// assert!(example.contains('A')); @@ -159,7 +159,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 67, 68, 69]; /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// assert!(example.contains_range(&('A'..'C'))); @@ -173,7 +173,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// use std::char; /// let check = char::from_u32(0xD7FE).unwrap() .. char::from_u32(0xE001).unwrap(); /// let example_list = vec![0xD7FE, 0xD7FF, 0xE000, 0xE001]; @@ -196,7 +196,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 70, 85, 91]; // A - E, U - Z /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// let a_to_d = UnicodeSet::from_inversion_list(vec![65, 69]).unwrap(); @@ -231,7 +231,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 68]; // {A, B, C} /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// assert_eq!(example.span("CABXYZ", true), 3); @@ -252,7 +252,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 68]; // {A, B, C} /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// assert_eq!(example.span_back("XYZCAB", true), 3); diff --git a/docs/style-guide.md b/docs/style-guide.md index d2f72c596d1..0acd741f725 100644 --- a/docs/style-guide.md +++ b/docs/style-guide.md @@ -33,7 +33,7 @@ Follow the naming advice in [Naming - Rust API Guidelines](https://rust-lang.git This should result in Crate names always being unambiguously mappable to/from package names (e.g. the Crate "foo_bar" relates to the package "foo-bar"). -Each component should have its own unique name in form `icu-{package}` which will be used for its releases. When released as part of the meta `icu` package, it will be re-exported as `icu::{package}::{struct}` and for core structures it may also be re-exported as `icu::{struct}}`. +Each component should have its own unique name in form `icu_{package}` which will be used for its releases. When released as part of the meta `icu` package, it will be re-exported as `icu::{package}::{struct}` and for core structures it may also be re-exported as `icu::{struct}}`. Within a single crate, exposure of structs and functions via their modules is up to the discretion of the author. As a rule of thumb, items that are required for common patterns should be available directly, while items needed only for a subset of use cases may be exposed via their modules. @@ -60,24 +60,24 @@ This concerns types that are available for public use outside of Rust. For similarly named types that serve analogous purposes in orthogonal APIs, prefer adopting slightly repetitive names as shown below: -* **DO**: `pluralrules::PluralRulesOptions` and `listformat::ListFormatOptions`. -* **DON'T**: `pluralrules::Options` and `listformat::Options`. +* **DO**: `plurals::PluralRulesOptions` and `listformat::ListFormatOptions`. +* **DON'T**: `plurals::Options` and `listformat::Options`. * **Rationale**: The ICU4X team has a preference for importing types by name and not using module names as disambiguators. In the 'DO' case above, one would do: ```rust use { - pluralrules::PluralRulesOptions, - listformat::ListFormatOptions, + plurals::PluralRulesOptions, + listformat::ListFormatOptions, } // ... later - let opt1 = PluralRulesOptions::new(); // vs pluralrules::Options::new() + let opt1 = PluralRulesOptions::new(); // vs plurals::Options::new() let opt2 = ListFormatOptions::new(); // vx listofrmat::Options::new() ``` -* **DO**: `pluralrules::PluralRulesError` -* **DON'T**: `pluralrules::Error` +* **DO**: `plurals::PluralRulesError` +* **DON'T**: `plurals::Error` * **Rationale**: In IDE and rustdoc, only an unqualified name (`Error`) appears, leading to confusion about what the fully qualified error type is. @@ -110,10 +110,10 @@ their type. | Package | Crate | Standalone Import | ICU Meta-package | |----|----|----|----| -| locale | `icu-locale` | `use icu_locale::Locale` | `use icu::Locale` | -| pluralrules | `icu-pluralrules` | `use icu_pluralrules::PluralRules` | `use icu::PluralRules` | -| datetime | `icu-datetime` | `use icu_datetime::DateTimeFormat` | `use icu::DateTimeFormat` | -| datetime | `icu-datetime` | `use icu_datetime::skeleton::SkeletonField` | `use icu::datetime::skeleton::SkeletonField` | +| locale | `icu_locale` | `use icu_locale::Locale` | `use icu::Locale` | +| plurals | `icu_plurals` | `use icu_plurals::PluralRules` | `use icu::PluralRules` | +| datetime | `icu_datetime` | `use icu_datetime::DateTimeFormat` | `use icu::DateTimeFormat` | +| datetime | `icu_datetime` | `use icu_datetime::skeleton::SkeletonField` | `use icu::datetime::skeleton::SkeletonField` | While the scheme may feel repetitive when looking at the import lines, it pays off in being unambigous without aliasing when multiple structs from different components get used together: diff --git a/resources/testdata/Cargo.toml b/resources/testdata/Cargo.toml index bbc69887aaf..ca1cded47f6 100644 --- a/resources/testdata/Cargo.toml +++ b/resources/testdata/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "icu-testdata" +name = "icu_testdata" description = "Test data for ICU4X, generated from CLDR." version = "0.0.1" authors = ["The ICU4X Project Developers"] @@ -85,9 +85,9 @@ locales = [ gitref = "36.0.0" [dependencies] -icu-data-provider = { path = "../../components/data-provider" } -icu-fs-data-provider = { path = "../../components/fs-data-provider" } -icu-locale = { path = "../../components/locale" } +icu_data_provider = { path = "../../components/data_provider" } +icu_fs_data_provider = { path = "../../components/fs_data_provider" } +icu_locale = { path = "../../components/locale" } # Dependencies for the "metadata" feature serde = { version = "1.0", features = ["derive"], optional = true } @@ -96,19 +96,19 @@ serde_json = { version = "1.0", optional = true } # Dependencies for the binary cargo_metadata = { version = "0.11.3", optional = true } clap = { version = "2.33", optional = true } -icu-cldr-json-data-provider = { path = "../../components/cldr-json-data-provider", optional = true, features = ["download"] } +icu_cldr_json_data_provider = { path = "../../components/cldr_json_data_provider", optional = true, features = ["download"] } log = { version = "0.4", optional = true } simple_logger = { version = "1.10", optional = true } [features] -metadata = ["serde", "serde_json", "icu-locale/serde"] +metadata = ["serde", "serde_json", "icu_locale/serde"] icu4x-gen-testdata = [ "cargo_metadata", "clap", - "icu-cldr-json-data-provider", + "icu_cldr_json_data_provider", "log", "simple_logger", - "icu-fs-data-provider/export", + "icu_fs_data_provider/export", "metadata", ] diff --git a/resources/testdata/src/lib.rs b/resources/testdata/src/lib.rs index 199c515c882..ceef33a5755 100644 --- a/resources/testdata/src/lib.rs +++ b/resources/testdata/src/lib.rs @@ -1,4 +1,4 @@ -//! `icu-testdata` is a unit testing package for [`ICU4X`]. +//! `icu_testdata` is a unit testing package for [`ICU4X`]. //! //! The package exposes a DataProvider with stable data useful for unit testing. The data is //! based on a CLDR tag and a short list of locales that, together, cover a range of scenarios. diff --git a/utils/fixed-decimal/Cargo.toml b/utils/fixed_decimal/Cargo.toml similarity index 96% rename from utils/fixed-decimal/Cargo.toml rename to utils/fixed_decimal/Cargo.toml index f3fb9901570..d2e4e836f2e 100644 --- a/utils/fixed-decimal/Cargo.toml +++ b/utils/fixed_decimal/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fixed-decimal" +name = "fixed_decimal" description = "An API for representing numbers in a human-readable form" version = "0.0.1" authors = ["The ICU4X Project Developers"] diff --git a/utils/fixed-decimal/README.md b/utils/fixed_decimal/README.md similarity index 100% rename from utils/fixed-decimal/README.md rename to utils/fixed_decimal/README.md diff --git a/utils/fixed-decimal/benches/fixed_decimal.rs b/utils/fixed_decimal/benches/fixed_decimal.rs similarity index 100% rename from utils/fixed-decimal/benches/fixed_decimal.rs rename to utils/fixed_decimal/benches/fixed_decimal.rs diff --git a/utils/fixed-decimal/examples/permyriad.rs b/utils/fixed_decimal/examples/permyriad.rs similarity index 100% rename from utils/fixed-decimal/examples/permyriad.rs rename to utils/fixed_decimal/examples/permyriad.rs diff --git a/utils/fixed-decimal/src/decimal.rs b/utils/fixed_decimal/src/decimal.rs similarity index 100% rename from utils/fixed-decimal/src/decimal.rs rename to utils/fixed_decimal/src/decimal.rs diff --git a/utils/fixed-decimal/src/lib.rs b/utils/fixed_decimal/src/lib.rs similarity index 100% rename from utils/fixed-decimal/src/lib.rs rename to utils/fixed_decimal/src/lib.rs diff --git a/utils/fixed-decimal/src/uint_iterator.rs b/utils/fixed_decimal/src/uint_iterator.rs similarity index 100% rename from utils/fixed-decimal/src/uint_iterator.rs rename to utils/fixed_decimal/src/uint_iterator.rs