From 7c82cb379cc5662e2f63a617d77d37dca631a0d5 Mon Sep 17 00:00:00 2001 From: Elango Date: Tue, 23 Mar 2021 22:32:37 -0700 Subject: [PATCH] Check all lines of license header (#551) --- .cargo/config.toml | 1 + .github/actions-rs/grcov.yml | 1 + .github/workflows/build-test.yml | 1 + .github/workflows/coverage.yml | 1 + Cargo.toml | 1 + Makefile.toml | 21 ++++++++++++++++--- codecov.yml | 1 + components/datetime/Cargo.toml | 1 + components/datetime/benches/datetime.rs | 1 + components/datetime/benches/fixtures/mod.rs | 1 + .../datetime/benches/fixtures/structs.rs | 1 + components/datetime/benches/pattern.rs | 1 + components/datetime/examples/work_log.rs | 1 + components/datetime/src/error.rs | 1 + components/datetime/src/fields/length.rs | 1 + components/datetime/src/fields/mod.rs | 1 + components/datetime/src/fields/symbols.rs | 1 + components/datetime/src/options/components.rs | 1 + components/datetime/src/options/mod.rs | 1 + .../datetime/src/options/preferences.rs | 1 + components/datetime/src/options/style.rs | 1 + components/datetime/src/pattern/error.rs | 1 + components/datetime/src/pattern/mod.rs | 1 + components/datetime/src/pattern/parser.rs | 1 + components/datetime/tests/datetime.rs | 1 + components/datetime/tests/fixtures/mod.rs | 1 + components/datetime/tests/fixtures/structs.rs | 1 + components/datetime/tests/patterns/mod.rs | 1 + components/datetime/tests/patterns/structs.rs | 1 + components/ecma402/Cargo.toml | 1 + components/ecma402/src/lib.rs | 2 +- components/ecma402/src/pluralrules.rs | 2 +- components/icu/Cargo.toml | 1 + components/icu/examples/tui.rs | 1 + components/icu/src/lib.rs | 1 + components/icu4x/Cargo.toml | 1 + components/icu4x/src/lib.rs | 1 + .../benches/helpers/mod.rs | 1 + .../benches/locale_canonicalizer.rs | 1 + .../src/locale_canonicalizer.rs | 1 + .../locale_canonicalizer/src/provider.rs | 1 + .../tests/fixtures/mod.rs | 1 + .../locale_canonicalizer/tests/helpers/mod.rs | 1 + .../tests/locale_canonicalizer.rs | 1 + components/locid/Cargo.toml | 1 + components/locid/benches/fixtures/mod.rs | 1 + components/locid/benches/helpers/macros.rs | 1 + components/locid/benches/helpers/mod.rs | 1 + components/locid/benches/langid.rs | 1 + components/locid/benches/locale.rs | 1 + components/locid/benches/subtags.rs | 1 + components/locid/examples/filter_langids.rs | 1 + .../syntatically_canonicalize_locales.rs | 1 + components/locid/macros/Cargo.toml | 1 + components/locid/macros/src/lib.rs | 1 + components/locid/macros/src/token_stream.rs | 1 + components/locid/macros/tests/macros.rs | 1 + components/locid/src/extensions/mod.rs | 1 + .../locid/src/extensions/private/key.rs | 1 + .../locid/src/extensions/private/mod.rs | 1 + .../locid/src/extensions/transform/fields.rs | 1 + .../locid/src/extensions/transform/key.rs | 1 + .../locid/src/extensions/transform/mod.rs | 1 + .../locid/src/extensions/transform/value.rs | 1 + .../locid/src/extensions/unicode/attribute.rs | 1 + .../src/extensions/unicode/attributes.rs | 1 + .../locid/src/extensions/unicode/key.rs | 1 + .../locid/src/extensions/unicode/keywords.rs | 1 + .../locid/src/extensions/unicode/mod.rs | 1 + .../locid/src/extensions/unicode/value.rs | 1 + components/locid/src/lib.rs | 1 + components/locid/src/locale.rs | 1 + components/locid/src/parser/errors.rs | 1 + components/locid/src/parser/langid.rs | 1 + components/locid/src/parser/locale.rs | 1 + components/locid/src/parser/mod.rs | 1 + components/locid/src/serde/langid.rs | 1 + components/locid/src/serde/mod.rs | 1 + components/locid/src/subtags/language.rs | 1 + components/locid/src/subtags/mod.rs | 1 + components/locid/src/subtags/region.rs | 1 + components/locid/src/subtags/script.rs | 1 + components/locid/src/subtags/variant.rs | 1 + components/locid/src/subtags/variants.rs | 1 + components/locid/tests/fixtures/mod.rs | 1 + components/locid/tests/helpers/mod.rs | 1 + components/locid/tests/langid.rs | 1 + components/locid/tests/locale.rs | 1 + components/plurals/Cargo.toml | 1 + components/plurals/benches/fixtures/mod.rs | 1 + components/plurals/benches/helpers/mod.rs | 1 + components/plurals/benches/operands.rs | 1 + components/plurals/benches/pluralrules.rs | 1 + .../plurals/examples/elevator_floors.rs | 1 + components/plurals/examples/unread_emails.rs | 1 + components/plurals/src/data.rs | 1 + components/plurals/src/lib.rs | 1 + components/plurals/src/operands.rs | 1 + components/plurals/src/rules/ast.rs | 1 + components/plurals/src/rules/lexer.rs | 1 + components/plurals/src/rules/mod.rs | 1 + components/plurals/src/rules/parser.rs | 1 + components/plurals/src/rules/resolver.rs | 1 + components/plurals/src/rules/serializer.rs | 1 + components/plurals/tests/fixtures/mod.rs | 1 + components/plurals/tests/helpers.rs | 1 + components/plurals/tests/operands.rs | 1 + components/plurals/tests/rules.rs | 1 + components/provider/Cargo.toml | 1 + components/provider/src/lib.rs | 1 + components/provider/tests/sizes.rs | 1 + components/provider_cldr/Cargo.toml | 1 + components/provider_cldr/src/cldr_langid.rs | 1 + components/provider_cldr/src/cldr_paths.rs | 1 + .../provider_cldr/src/download/error.rs | 1 + .../provider_cldr/src/download/io_util.rs | 1 + components/provider_cldr/src/error.rs | 1 + components/provider_cldr/src/lib.rs | 1 + components/provider_cldr/src/reader.rs | 1 + components/provider_cldr/src/support.rs | 1 + .../src/transform/likelysubtags.rs | 1 + components/provider_cldr/src/transform/mod.rs | 1 + .../provider_cldr/src/transform/plurals.rs | 1 + components/provider_fs/Cargo.toml | 1 + .../provider_fs/src/bin/icu4x-cldr-export.rs | 1 + components/provider_fs/src/deserializer.rs | 1 + components/provider_fs/src/error.rs | 1 + .../provider_fs/src/export/fs_exporter.rs | 1 + components/provider_fs/src/export/mod.rs | 1 + .../src/export/serializers/bincode.rs | 1 + .../src/export/serializers/json.rs | 1 + .../provider_fs/src/export/serializers/mod.rs | 1 + .../provider_fs/src/fs_data_provider.rs | 1 + components/provider_fs/src/lib.rs | 1 + components/provider_fs/src/manifest.rs | 1 + components/provider_ppucd/src/error.rs | 1 + components/provider_ppucd/src/parse_ppucd.rs | 1 + components/provider_ppucd/tests/props_test.rs | 1 + components/uniset/Cargo.toml | 1 + components/uniset/benches/inv_list.rs | 1 + .../examples/unicode_bmp_blocks_selector.rs | 1 + components/uniset/src/builder.rs | 1 + components/uniset/src/conversions.rs | 1 + components/uniset/src/lib.rs | 1 + components/uniset/src/props.rs | 1 + components/uniset/src/uniset.rs | 1 + components/uniset/src/utils.rs | 1 + experimental/segmenter_lstm/Cargo.toml | 1 + resources/testdata/Cargo.toml | 1 + .../testdata/src/bin/icu4x-gen-testdata.rs | 1 + resources/testdata/src/lib.rs | 1 + resources/testdata/src/metadata.rs | 1 + resources/testdata/src/test_data_provider.rs | 1 + tools/benchmark/macros/Cargo.toml | 1 + tools/benchmark/memory/Cargo.toml | 1 + tools/benchmark/memory/src/main.rs | 1 + utils/fixed_decimal/Cargo.toml | 1 + utils/fixed_decimal/benches/fixed_decimal.rs | 1 + utils/fixed_decimal/examples/permyriad.rs | 1 + utils/fixed_decimal/src/decimal.rs | 1 + utils/fixed_decimal/src/lib.rs | 1 + utils/fixed_decimal/src/uint_iterator.rs | 1 + utils/writeable/benches/writeable.rs | 1 + utils/writeable/tests/writeable.rs | 1 + 164 files changed, 181 insertions(+), 5 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 75eb4713ce0..c873d12f1ba 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [alias] ### INDIVIDUAL TEST AND LINT TASKS ### diff --git a/.github/actions-rs/grcov.yml b/.github/actions-rs/grcov.yml index 81f52566a89..3af8e58d7c4 100644 --- a/.github/actions-rs/grcov.yml +++ b/.github/actions-rs/grcov.yml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + ignore: - "/*" - "C:/*" diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 4056b2e070f..da75daa8ab8 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + name: Build and Test # TODO(#234) re-include cache steps, also using Rust version in cache key diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index efe0f1a269a..66ee5d94cad 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + name: Coverage on: diff --git a/Cargo.toml b/Cargo.toml index 6b0f9ac1e63..8aa8d381a24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [workspace] members = [ diff --git a/Makefile.toml b/Makefile.toml index faf69686fd1..c1c02ad803a 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [config] default_to_workspace = false load_cargo_aliases = true @@ -34,18 +35,32 @@ exit_on_error true glob_pattern_array = array "./**/*.rs" "./**/*.yml" "./**/*.toml" +blank_line = set "" + +license_hash_line_1 = set "# This file is part of ICU4X. For terms of use, please see the file" +license_hash_line_2 = set "# called LICENSE at the top level of the ICU4X source tree" +license_hash_line_3 = set "# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE )." +license_hash_array = array ${license_hash_line_1} ${license_hash_line_2} ${license_hash_line_3} ${blank_line} +license_hash_str = array_join ${license_hash_array} "\n" + +license_slash_line_1 = set "// This file is part of ICU4X. For terms of use, please see the file" +license_slash_line_2 = set "// called LICENSE at the top level of the ICU4X source tree" +license_slash_line_3 = set "// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE )." +license_slash_array = array ${license_slash_line_1} ${license_slash_line_2} ${license_slash_line_3} ${blank_line} +license_slash_str = array_join ${license_slash_array} "\n" + for pattern in ${glob_pattern_array} handle = glob_array ${pattern} for path in ${handle} if not starts_with ${path} "target" # skip paths in target dir text = readfile ${path} - result_hash = starts_with ${text} "# This file is part of ICU4X. For terms of use, please see the file" - result_slash = starts_with ${text} "// This file is part of ICU4X. For terms of use, please see the file" + result_hash = starts_with ${text} ${license_hash_str} + result_slash = starts_with ${text} ${license_slash_str} not_result_hash = not ${result_hash} not_result_slash = not ${result_slash} if ${not_result_hash} and ${not_result_slash} echo "License header missing in ${path}" - trigger_error "License header missing in ${path}" + trigger_error "License header missing or misformatted in ${path}." end end end diff --git a/codecov.yml b/codecov.yml index ed031ac2ee3..122bdfd2e84 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + ignore: - "/*" - "C:/*" diff --git a/components/datetime/Cargo.toml b/components/datetime/Cargo.toml index 012165016c8..73ab04a1972 100644 --- a/components/datetime/Cargo.toml +++ b/components/datetime/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_datetime" description = "API for formatting date and time to user readable textual representation" diff --git a/components/datetime/benches/datetime.rs b/components/datetime/benches/datetime.rs index 9278e8cfe91..927ffceaa6e 100644 --- a/components/datetime/benches/datetime.rs +++ b/components/datetime/benches/datetime.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; use criterion::{criterion_group, criterion_main, Criterion}; diff --git a/components/datetime/benches/fixtures/mod.rs b/components/datetime/benches/fixtures/mod.rs index 2659e2bd24b..1968a9d1533 100644 --- a/components/datetime/benches/fixtures/mod.rs +++ b/components/datetime/benches/fixtures/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + pub mod structs; use icu_datetime::options::{style, DateTimeFormatOptions}; diff --git a/components/datetime/benches/fixtures/structs.rs b/components/datetime/benches/fixtures/structs.rs index 7be2078b28d..b9a76696dd8 100644 --- a/components/datetime/benches/fixtures/structs.rs +++ b/components/datetime/benches/fixtures/structs.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] diff --git a/components/datetime/benches/pattern.rs b/components/datetime/benches/pattern.rs index 36a9ab75b3a..0ae55a60656 100644 --- a/components/datetime/benches/pattern.rs +++ b/components/datetime/benches/pattern.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; use criterion::{criterion_group, criterion_main, Criterion}; diff --git a/components/datetime/examples/work_log.rs b/components/datetime/examples/work_log.rs index d316389fd41..71b8ebb82a6 100644 --- a/components/datetime/examples/work_log.rs +++ b/components/datetime/examples/work_log.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + // An example application which uses icu_datetime to format entries // from a work log into human readable dates and times. diff --git a/components/datetime/src/error.rs b/components/datetime/src/error.rs index d5f2563b1e2..e974b4094f2 100644 --- a/components/datetime/src/error.rs +++ b/components/datetime/src/error.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::pattern; use icu_provider::prelude::DataError; diff --git a/components/datetime/src/fields/length.rs b/components/datetime/src/fields/length.rs index 684014d051c..847a1a73051 100644 --- a/components/datetime/src/fields/length.rs +++ b/components/datetime/src/fields/length.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::convert::TryFrom; #[derive(Debug)] diff --git a/components/datetime/src/fields/mod.rs b/components/datetime/src/fields/mod.rs index 192f6894e1d..bfb4d83a27f 100644 --- a/components/datetime/src/fields/mod.rs +++ b/components/datetime/src/fields/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod length; mod symbols; diff --git a/components/datetime/src/fields/symbols.rs b/components/datetime/src/fields/symbols.rs index 9a4b729ed87..66f2150e4d1 100644 --- a/components/datetime/src/fields/symbols.rs +++ b/components/datetime/src/fields/symbols.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::convert::TryFrom; #[derive(Debug)] diff --git a/components/datetime/src/options/components.rs b/components/datetime/src/options/components.rs index f34d93b058f..79e618c4e8c 100644 --- a/components/datetime/src/options/components.rs +++ b/components/datetime/src/options/components.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! Components is a model of encoding information on how to format date and time by specifying a list of components //! the user wants to be visible in the formatted string and how each field should be displayed. //! diff --git a/components/datetime/src/options/mod.rs b/components/datetime/src/options/mod.rs index 683a0101d1e..0ca7be45e51 100644 --- a/components/datetime/src/options/mod.rs +++ b/components/datetime/src/options/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `DateTimeFormatOptions` is a bag of options which, together with `LanguageIdentifier`, //! define how dates will be formatted be a `DateTimeFormat` instance. //! diff --git a/components/datetime/src/options/preferences.rs b/components/datetime/src/options/preferences.rs index 18d5407412e..69ac2f5b7c9 100644 --- a/components/datetime/src/options/preferences.rs +++ b/components/datetime/src/options/preferences.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! Preferences is a bag of options to be associated with either `Style` or `Components` bag which provides //! information on user preferences that can affect the result of the formatting. //! diff --git a/components/datetime/src/options/style.rs b/components/datetime/src/options/style.rs index 8ab6de9e47f..47aae1fcbdb 100644 --- a/components/datetime/src/options/style.rs +++ b/components/datetime/src/options/style.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! Style is a model of encoding information on how to format date and time by specifying the preferred length //! of date and time fields. //! diff --git a/components/datetime/src/pattern/error.rs b/components/datetime/src/pattern/error.rs index 073b4092825..a824d20e24b 100644 --- a/components/datetime/src/pattern/error.rs +++ b/components/datetime/src/pattern/error.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::fields; #[derive(Debug, PartialEq)] diff --git a/components/datetime/src/pattern/mod.rs b/components/datetime/src/pattern/mod.rs index 028e155ca10..794e9afaa74 100644 --- a/components/datetime/src/pattern/mod.rs +++ b/components/datetime/src/pattern/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod error; mod parser; diff --git a/components/datetime/src/pattern/parser.rs b/components/datetime/src/pattern/parser.rs index c146f04684b..585506267f0 100644 --- a/components/datetime/src/pattern/parser.rs +++ b/components/datetime/src/pattern/parser.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use super::error::Error; use super::{Pattern, PatternItem}; use crate::fields::FieldSymbol; diff --git a/components/datetime/tests/datetime.rs b/components/datetime/tests/datetime.rs index 0ec37b9b679..8e1fdc7e2b5 100644 --- a/components/datetime/tests/datetime.rs +++ b/components/datetime/tests/datetime.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + #![cfg(all(not(feature = "serialize_none"), feature = "serde"))] mod fixtures; diff --git a/components/datetime/tests/fixtures/mod.rs b/components/datetime/tests/fixtures/mod.rs index 0a8b6d2f5a6..fdcf019cd23 100644 --- a/components/datetime/tests/fixtures/mod.rs +++ b/components/datetime/tests/fixtures/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + #![cfg(all(not(feature = "serialize_none"), feature = "serde"))] pub mod structs; diff --git a/components/datetime/tests/fixtures/structs.rs b/components/datetime/tests/fixtures/structs.rs index 6829f153376..3b85a785894 100644 --- a/components/datetime/tests/fixtures/structs.rs +++ b/components/datetime/tests/fixtures/structs.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + #![cfg(all(not(feature = "serialize_none"), feature = "serde"))] use icu_datetime::options::{components, style}; diff --git a/components/datetime/tests/patterns/mod.rs b/components/datetime/tests/patterns/mod.rs index 5f0839e2d43..66d020d1cfa 100644 --- a/components/datetime/tests/patterns/mod.rs +++ b/components/datetime/tests/patterns/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + pub mod structs; use std::fs::File; diff --git a/components/datetime/tests/patterns/structs.rs b/components/datetime/tests/patterns/structs.rs index 8dfa75b3e3e..4c2ece3ef21 100644 --- a/components/datetime/tests/patterns/structs.rs +++ b/components/datetime/tests/patterns/structs.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] diff --git a/components/ecma402/Cargo.toml b/components/ecma402/Cargo.toml index b89c6720d9e..7e16890ce2f 100644 --- a/components/ecma402/Cargo.toml +++ b/components/ecma402/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu4x_ecma402" description = "ECMA-402 API functionality backed by the ICU4X library" diff --git a/components/ecma402/src/lib.rs b/components/ecma402/src/lib.rs index 4956cc73f15..3f2fdab07c3 100644 --- a/components/ecma402/src/lib.rs +++ b/components/ecma402/src/lib.rs @@ -1,6 +1,6 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree -// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ) +// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). use icu::locid::LanguageIdentifier; diff --git a/components/ecma402/src/pluralrules.rs b/components/ecma402/src/pluralrules.rs index 49af2a7c63f..c7fcdc98028 100644 --- a/components/ecma402/src/pluralrules.rs +++ b/components/ecma402/src/pluralrules.rs @@ -1,6 +1,6 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree -// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ) +// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). //! Implements the traits found in [`ecma402_traits::pluralrules`]. diff --git a/components/icu/Cargo.toml b/components/icu/Cargo.toml index ebecff09522..180c2bac6e7 100644 --- a/components/icu/Cargo.toml +++ b/components/icu/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu" description = "International Components for Unicode" diff --git a/components/icu/examples/tui.rs b/components/icu/examples/tui.rs index 5ba75d35ca7..a822e2bfbf5 100644 --- a/components/icu/examples/tui.rs +++ b/components/icu/examples/tui.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + // An example program making use of a number of ICU components // in a pseudo-real-world application of Textual User Interface. diff --git a/components/icu/src/lib.rs b/components/icu/src/lib.rs index 29d857b7c81..cd83ee7918d 100644 --- a/components/icu/src/lib.rs +++ b/components/icu/src/lib.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `icu` is the main meta-package of the `ICU4X` project. //! //! It provides a comperhensive selection of Unicode Internationalization Components diff --git a/components/icu4x/Cargo.toml b/components/icu4x/Cargo.toml index fd6187b1c53..1abd3c752e2 100644 --- a/components/icu4x/Cargo.toml +++ b/components/icu4x/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu4x" description = "International Components for Unicode" diff --git a/components/icu4x/src/lib.rs b/components/icu4x/src/lib.rs index 18718a84826..6492155bb1f 100644 --- a/components/icu4x/src/lib.rs +++ b/components/icu4x/src/lib.rs @@ -1,4 +1,5 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `icu4x` is an alias to the [`icu`](../icu/index.html) package. diff --git a/components/locale_canonicalizer/benches/helpers/mod.rs b/components/locale_canonicalizer/benches/helpers/mod.rs index 546b2a3d2dc..d250c510c59 100644 --- a/components/locale_canonicalizer/benches/helpers/mod.rs +++ b/components/locale_canonicalizer/benches/helpers/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::fs::File; use std::io::{BufReader, Error}; diff --git a/components/locale_canonicalizer/benches/locale_canonicalizer.rs b/components/locale_canonicalizer/benches/locale_canonicalizer.rs index 3a5c4203e3f..5ca001ad828 100644 --- a/components/locale_canonicalizer/benches/locale_canonicalizer.rs +++ b/components/locale_canonicalizer/benches/locale_canonicalizer.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod helpers; use criterion::{criterion_group, criterion_main, Criterion}; diff --git a/components/locale_canonicalizer/src/locale_canonicalizer.rs b/components/locale_canonicalizer/src/locale_canonicalizer.rs index ffa256e5f93..879d2d651d2 100644 --- a/components/locale_canonicalizer/src/locale_canonicalizer.rs +++ b/components/locale_canonicalizer/src/locale_canonicalizer.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::provider::*; use icu_locid::LanguageIdentifier; use icu_provider::prelude::*; diff --git a/components/locale_canonicalizer/src/provider.rs b/components/locale_canonicalizer/src/provider.rs index ee0c64f7a22..a9b3bfc2c08 100644 --- a/components/locale_canonicalizer/src/provider.rs +++ b/components/locale_canonicalizer/src/provider.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use icu_locid::LanguageIdentifier; pub mod key { diff --git a/components/locale_canonicalizer/tests/fixtures/mod.rs b/components/locale_canonicalizer/tests/fixtures/mod.rs index a8cbd40ec5a..4318faf2eda 100644 --- a/components/locale_canonicalizer/tests/fixtures/mod.rs +++ b/components/locale_canonicalizer/tests/fixtures/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use serde::Deserialize; #[derive(Deserialize)] diff --git a/components/locale_canonicalizer/tests/helpers/mod.rs b/components/locale_canonicalizer/tests/helpers/mod.rs index 546b2a3d2dc..d250c510c59 100644 --- a/components/locale_canonicalizer/tests/helpers/mod.rs +++ b/components/locale_canonicalizer/tests/helpers/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::fs::File; use std::io::{BufReader, Error}; diff --git a/components/locale_canonicalizer/tests/locale_canonicalizer.rs b/components/locale_canonicalizer/tests/locale_canonicalizer.rs index 067ab15378a..44692b17eca 100644 --- a/components/locale_canonicalizer/tests/locale_canonicalizer.rs +++ b/components/locale_canonicalizer/tests/locale_canonicalizer.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; mod helpers; diff --git a/components/locid/Cargo.toml b/components/locid/Cargo.toml index 6115cdc9646..048da826469 100644 --- a/components/locid/Cargo.toml +++ b/components/locid/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_locid" description = "API for managing Unicode Language and Locale Identifiers" diff --git a/components/locid/benches/fixtures/mod.rs b/components/locid/benches/fixtures/mod.rs index 23bba36b103..006b2231208 100644 --- a/components/locid/benches/fixtures/mod.rs +++ b/components/locid/benches/fixtures/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use serde::Deserialize; #[derive(Deserialize)] diff --git a/components/locid/benches/helpers/macros.rs b/components/locid/benches/helpers/macros.rs index af6a2aa4398..b7232cf587c 100644 --- a/components/locid/benches/helpers/macros.rs +++ b/components/locid/benches/helpers/macros.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + #[macro_export] macro_rules! overview { ($c:expr, $struct:ident, $data_str:expr, $compare:expr) => { diff --git a/components/locid/benches/helpers/mod.rs b/components/locid/benches/helpers/mod.rs index ec9f7bd9227..27e455f7bec 100644 --- a/components/locid/benches/helpers/mod.rs +++ b/components/locid/benches/helpers/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod macros; use std::fs::File; diff --git a/components/locid/benches/langid.rs b/components/locid/benches/langid.rs index 12064405f91..1361331f851 100644 --- a/components/locid/benches/langid.rs +++ b/components/locid/benches/langid.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; mod helpers; diff --git a/components/locid/benches/locale.rs b/components/locid/benches/locale.rs index 3d04ce21ca3..948fbb5e8e5 100644 --- a/components/locid/benches/locale.rs +++ b/components/locid/benches/locale.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; mod helpers; diff --git a/components/locid/benches/subtags.rs b/components/locid/benches/subtags.rs index 252e3745262..4f81b71d2e0 100644 --- a/components/locid/benches/subtags.rs +++ b/components/locid/benches/subtags.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; mod helpers; diff --git a/components/locid/examples/filter_langids.rs b/components/locid/examples/filter_langids.rs index 083d89b5448..0a6a0da3ed0 100644 --- a/components/locid/examples/filter_langids.rs +++ b/components/locid/examples/filter_langids.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + // A sample application which takes a comma separated list of language identifiers, // filters out identifiers with language subtags different than `en` and serializes // the list back into a comma separated list in canonical syntax. diff --git a/components/locid/examples/syntatically_canonicalize_locales.rs b/components/locid/examples/syntatically_canonicalize_locales.rs index 6926951eb6b..944ef4293fc 100644 --- a/components/locid/examples/syntatically_canonicalize_locales.rs +++ b/components/locid/examples/syntatically_canonicalize_locales.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + // A sample application which takes a comma separated list of locales, // makes them syntatically canonical and serializes the list back into a comma separated list. diff --git a/components/locid/macros/Cargo.toml b/components/locid/macros/Cargo.toml index a446a8b1bbc..78a6d4f097c 100644 --- a/components/locid/macros/Cargo.toml +++ b/components/locid/macros/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_locid_macros" description = "proc-macros for icu_locid" diff --git a/components/locid/macros/src/lib.rs b/components/locid/macros/src/lib.rs index 16fe05bfb94..05ef18b9e3b 100644 --- a/components/locid/macros/src/lib.rs +++ b/components/locid/macros/src/lib.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod token_stream; extern crate proc_macro; diff --git a/components/locid/macros/src/token_stream.rs b/components/locid/macros/src/token_stream.rs index 876334c4402..5c2cd0b675b 100644 --- a/components/locid/macros/src/token_stream.rs +++ b/components/locid/macros/src/token_stream.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use icu_locid::subtags; extern crate proc_macro; diff --git a/components/locid/macros/tests/macros.rs b/components/locid/macros/tests/macros.rs index 81053fbf782..16bd9d4f1fe 100644 --- a/components/locid/macros/tests/macros.rs +++ b/components/locid/macros/tests/macros.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use icu_locid::subtags; use icu_locid::LanguageIdentifier; use icu_locid_macros::*; diff --git a/components/locid/src/extensions/mod.rs b/components/locid/src/extensions/mod.rs index 0cadd079ba6..cd55b848852 100644 --- a/components/locid/src/extensions/mod.rs +++ b/components/locid/src/extensions/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! Unicode Extensions provide a mechanism to extend the [`LanguageIdentifier`] with //! additional bits of information - a combination of a [`LanguageIdentifier`] and `Extensions` //! is called [`Locale`]. diff --git a/components/locid/src/extensions/private/key.rs b/components/locid/src/extensions/private/key.rs index 34142e1a340..2ff9da8e878 100644 --- a/components/locid/src/extensions/private/key.rs +++ b/components/locid/src/extensions/private/key.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::ops::RangeInclusive; use std::str::FromStr; diff --git a/components/locid/src/extensions/private/mod.rs b/components/locid/src/extensions/private/mod.rs index c1abc926446..dd09545bfea 100644 --- a/components/locid/src/extensions/private/mod.rs +++ b/components/locid/src/extensions/private/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! Private Use Extensions is a list of extensions intended for //! private use. //! diff --git a/components/locid/src/extensions/transform/fields.rs b/components/locid/src/extensions/transform/fields.rs index 517a12b9d5a..e39203e5316 100644 --- a/components/locid/src/extensions/transform/fields.rs +++ b/components/locid/src/extensions/transform/fields.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::borrow::Borrow; use std::ops::Deref; diff --git a/components/locid/src/extensions/transform/key.rs b/components/locid/src/extensions/transform/key.rs index db887d6cf89..94189947df7 100644 --- a/components/locid/src/extensions/transform/key.rs +++ b/components/locid/src/extensions/transform/key.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::parser::errors::ParserError; use std::str::FromStr; use tinystr::TinyStr4; diff --git a/components/locid/src/extensions/transform/mod.rs b/components/locid/src/extensions/transform/mod.rs index 131b54fb5dd..487ec47b021 100644 --- a/components/locid/src/extensions/transform/mod.rs +++ b/components/locid/src/extensions/transform/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! Transform Extensions provide information on content transformations in a given locale. //! //! The main struct for this extension is [`Transform`] which contains [`Fields`] and an diff --git a/components/locid/src/extensions/transform/value.rs b/components/locid/src/extensions/transform/value.rs index 6fe954d7c95..3453ea1b04a 100644 --- a/components/locid/src/extensions/transform/value.rs +++ b/components/locid/src/extensions/transform/value.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::parser::{get_subtag_iterator, ParserError}; use std::ops::RangeInclusive; use std::str::FromStr; diff --git a/components/locid/src/extensions/unicode/attribute.rs b/components/locid/src/extensions/unicode/attribute.rs index 3f579f60595..cb409de091e 100644 --- a/components/locid/src/extensions/unicode/attribute.rs +++ b/components/locid/src/extensions/unicode/attribute.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::ops::RangeInclusive; use std::str::FromStr; diff --git a/components/locid/src/extensions/unicode/attributes.rs b/components/locid/src/extensions/unicode/attributes.rs index dde039f142b..1725fbdefde 100644 --- a/components/locid/src/extensions/unicode/attributes.rs +++ b/components/locid/src/extensions/unicode/attributes.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use super::Attribute; use std::ops::Deref; diff --git a/components/locid/src/extensions/unicode/key.rs b/components/locid/src/extensions/unicode/key.rs index a1a54131835..c232e62896e 100644 --- a/components/locid/src/extensions/unicode/key.rs +++ b/components/locid/src/extensions/unicode/key.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::str::FromStr; use crate::parser::errors::ParserError; diff --git a/components/locid/src/extensions/unicode/keywords.rs b/components/locid/src/extensions/unicode/keywords.rs index 96e89060e27..878cff63d39 100644 --- a/components/locid/src/extensions/unicode/keywords.rs +++ b/components/locid/src/extensions/unicode/keywords.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::borrow::Borrow; use std::ops::Deref; diff --git a/components/locid/src/extensions/unicode/mod.rs b/components/locid/src/extensions/unicode/mod.rs index 42e93efeac7..fae2f133a88 100644 --- a/components/locid/src/extensions/unicode/mod.rs +++ b/components/locid/src/extensions/unicode/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! Unicode Extensions provide information about user preferences in a given locale. //! //! The main struct for this extension is [`Unicode`] which contains [`Keywords`] and diff --git a/components/locid/src/extensions/unicode/value.rs b/components/locid/src/extensions/unicode/value.rs index 25858c558c5..b8e0ff6c989 100644 --- a/components/locid/src/extensions/unicode/value.rs +++ b/components/locid/src/extensions/unicode/value.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::parser::{get_subtag_iterator, ParserError}; use std::ops::RangeInclusive; use std::str::FromStr; diff --git a/components/locid/src/lib.rs b/components/locid/src/lib.rs index ff3bd6ba393..663cc500618 100644 --- a/components/locid/src/lib.rs +++ b/components/locid/src/lib.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `icu_locid` is one of the [`ICU4X`] components. //! //! This API provides necessary functionality for parsing, manipulating, and serializing Unicode Language diff --git a/components/locid/src/locale.rs b/components/locid/src/locale.rs index fd0de8a4690..8ae39ce44c0 100644 --- a/components/locid/src/locale.rs +++ b/components/locid/src/locale.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::parser::{get_subtag_iterator, parse_locale, ParserError}; use crate::{extensions, subtags, LanguageIdentifier}; use std::str::FromStr; diff --git a/components/locid/src/parser/errors.rs b/components/locid/src/parser/errors.rs index 1e6aa8ad492..de6e8ebf1d0 100644 --- a/components/locid/src/parser/errors.rs +++ b/components/locid/src/parser/errors.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::error::Error; use std::fmt::{self, Display}; diff --git a/components/locid/src/parser/langid.rs b/components/locid/src/parser/langid.rs index bea2fb487ed..d57d05b7ea2 100644 --- a/components/locid/src/parser/langid.rs +++ b/components/locid/src/parser/langid.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::iter::Peekable; pub use super::errors::ParserError; diff --git a/components/locid/src/parser/locale.rs b/components/locid/src/parser/locale.rs index 35106a4f0f1..c498763563b 100644 --- a/components/locid/src/parser/locale.rs +++ b/components/locid/src/parser/locale.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::extensions::Extensions; use crate::parser::errors::ParserError; use crate::parser::{get_subtag_iterator, parse_language_identifier_from_iter, ParserMode}; diff --git a/components/locid/src/parser/mod.rs b/components/locid/src/parser/mod.rs index eab3da6a2de..b4129efe7cb 100644 --- a/components/locid/src/parser/mod.rs +++ b/components/locid/src/parser/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + pub mod errors; mod langid; mod locale; diff --git a/components/locid/src/serde/langid.rs b/components/locid/src/serde/langid.rs index deced80be1b..6d4fab47f7c 100644 --- a/components/locid/src/serde/langid.rs +++ b/components/locid/src/serde/langid.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::LanguageIdentifier; use serde::{Deserialize, Deserializer, Serialize, Serializer}; diff --git a/components/locid/src/serde/mod.rs b/components/locid/src/serde/mod.rs index 63f0b8baee6..69cf111551d 100644 --- a/components/locid/src/serde/mod.rs +++ b/components/locid/src/serde/mod.rs @@ -1,4 +1,5 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod langid; diff --git a/components/locid/src/subtags/language.rs b/components/locid/src/subtags/language.rs index c3034fae30d..73d2c2c25d4 100644 --- a/components/locid/src/subtags/language.rs +++ b/components/locid/src/subtags/language.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::parser::errors::ParserError; use std::fmt; use std::ops::RangeInclusive; diff --git a/components/locid/src/subtags/mod.rs b/components/locid/src/subtags/mod.rs index 07fa14f17e9..cda1f251683 100644 --- a/components/locid/src/subtags/mod.rs +++ b/components/locid/src/subtags/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! Language Identifier and Locale contains a set of subtags //! which represent different fields of the structure. //! diff --git a/components/locid/src/subtags/region.rs b/components/locid/src/subtags/region.rs index 382faf58316..d2172ddf4dd 100644 --- a/components/locid/src/subtags/region.rs +++ b/components/locid/src/subtags/region.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::parser::errors::ParserError; use std::str::FromStr; use tinystr::TinyStr4; diff --git a/components/locid/src/subtags/script.rs b/components/locid/src/subtags/script.rs index 6937fa5b64a..2eeb7de1d6d 100644 --- a/components/locid/src/subtags/script.rs +++ b/components/locid/src/subtags/script.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::parser::errors::ParserError; use std::str::FromStr; use tinystr::TinyStr4; diff --git a/components/locid/src/subtags/variant.rs b/components/locid/src/subtags/variant.rs index 227e7256f80..1c7e600eac0 100644 --- a/components/locid/src/subtags/variant.rs +++ b/components/locid/src/subtags/variant.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::parser::errors::ParserError; use std::ops::RangeInclusive; use std::str::FromStr; diff --git a/components/locid/src/subtags/variants.rs b/components/locid/src/subtags/variants.rs index 74df9ecd025..7fba91476b8 100644 --- a/components/locid/src/subtags/variants.rs +++ b/components/locid/src/subtags/variants.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use super::Variant; use std::ops::Deref; diff --git a/components/locid/tests/fixtures/mod.rs b/components/locid/tests/fixtures/mod.rs index 8b2e5a5385a..b95e57d3db7 100644 --- a/components/locid/tests/fixtures/mod.rs +++ b/components/locid/tests/fixtures/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::collections::HashMap; use std::convert::{TryFrom, TryInto}; diff --git a/components/locid/tests/helpers/mod.rs b/components/locid/tests/helpers/mod.rs index 546b2a3d2dc..d250c510c59 100644 --- a/components/locid/tests/helpers/mod.rs +++ b/components/locid/tests/helpers/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::fs::File; use std::io::{BufReader, Error}; diff --git a/components/locid/tests/langid.rs b/components/locid/tests/langid.rs index 8f29ecf6d40..2ba2eabf3da 100644 --- a/components/locid/tests/langid.rs +++ b/components/locid/tests/langid.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; mod helpers; diff --git a/components/locid/tests/locale.rs b/components/locid/tests/locale.rs index 957f2718260..aefd05c363f 100644 --- a/components/locid/tests/locale.rs +++ b/components/locid/tests/locale.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; mod helpers; diff --git a/components/plurals/Cargo.toml b/components/plurals/Cargo.toml index 5781362bd83..99733aeb8f7 100644 --- a/components/plurals/Cargo.toml +++ b/components/plurals/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_plurals" description = "Unicode Plural Rules categorizer for numeric input" diff --git a/components/plurals/benches/fixtures/mod.rs b/components/plurals/benches/fixtures/mod.rs index 56138c31712..211e7e506d7 100644 --- a/components/plurals/benches/fixtures/mod.rs +++ b/components/plurals/benches/fixtures/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use icu_locid::LanguageIdentifier; use icu_plurals::PluralCategory; diff --git a/components/plurals/benches/helpers/mod.rs b/components/plurals/benches/helpers/mod.rs index a9a9dc08ab6..b2a1b3227bf 100644 --- a/components/plurals/benches/helpers/mod.rs +++ b/components/plurals/benches/helpers/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::fs::File; use std::io::{BufReader, Error}; diff --git a/components/plurals/benches/operands.rs b/components/plurals/benches/operands.rs index 7fbc053323d..4d41f14f77b 100644 --- a/components/plurals/benches/operands.rs +++ b/components/plurals/benches/operands.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; mod helpers; diff --git a/components/plurals/benches/pluralrules.rs b/components/plurals/benches/pluralrules.rs index a14bb6bda8f..4af975b66b7 100644 --- a/components/plurals/benches/pluralrules.rs +++ b/components/plurals/benches/pluralrules.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; mod helpers; diff --git a/components/plurals/examples/elevator_floors.rs b/components/plurals/examples/elevator_floors.rs index 8fb31f62918..8737cb4a9f0 100644 --- a/components/plurals/examples/elevator_floors.rs +++ b/components/plurals/examples/elevator_floors.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + // An example application which uses icu_plurals to construct a correct // sentence for English based on the numerical value in Ordinal category. diff --git a/components/plurals/examples/unread_emails.rs b/components/plurals/examples/unread_emails.rs index 4a628d634cf..70032531669 100644 --- a/components/plurals/examples/unread_emails.rs +++ b/components/plurals/examples/unread_emails.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + // An example application which uses icu_plurals to construct a correct // sentence for English based on the numerical value in Cardinal category. diff --git a/components/plurals/src/data.rs b/components/plurals/src/data.rs index adb8c0caea5..24b00406e46 100644 --- a/components/plurals/src/data.rs +++ b/components/plurals/src/data.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::operands::PluralOperands; use crate::provider::PluralRuleStringsV1; use crate::rules; diff --git a/components/plurals/src/lib.rs b/components/plurals/src/lib.rs index 4ce6b3f13db..aab58b40e0b 100644 --- a/components/plurals/src/lib.rs +++ b/components/plurals/src/lib.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `icu_plurals` is one of the [`ICU4X`] components. //! //! This API provides functionality to determine the plural category diff --git a/components/plurals/src/operands.rs b/components/plurals/src/operands.rs index 93f2e444f13..535ec6043c7 100644 --- a/components/plurals/src/operands.rs +++ b/components/plurals/src/operands.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use fixed_decimal::FixedDecimal; use std::convert::TryFrom; use std::io::Error as IOError; diff --git a/components/plurals/src/rules/ast.rs b/components/plurals/src/rules/ast.rs index f409e09cd18..df71f42f687 100644 --- a/components/plurals/src/rules/ast.rs +++ b/components/plurals/src/rules/ast.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `AST` provides a set of Syntax Tree Nodes used to store //! the output of [`parse`] method that is used in [`test_condition`] method //! to evaluate whether a given [`PluralCategory`] should be used. diff --git a/components/plurals/src/rules/lexer.rs b/components/plurals/src/rules/lexer.rs index c8d8d79d789..2740c0f10b0 100644 --- a/components/plurals/src/rules/lexer.rs +++ b/components/plurals/src/rules/lexer.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use super::ast; #[derive(Debug, PartialEq)] diff --git a/components/plurals/src/rules/mod.rs b/components/plurals/src/rules/mod.rs index a0ef135b9c1..6cd9ab3bf55 100644 --- a/components/plurals/src/rules/mod.rs +++ b/components/plurals/src/rules/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! APIs and Data Structures for Plural Rules //! //! A single Plural Rule is an expression which tests the value of [`PluralOperands`] diff --git a/components/plurals/src/rules/parser.rs b/components/plurals/src/rules/parser.rs index afc2eb5975a..c9c7d61dd75 100644 --- a/components/plurals/src/rules/parser.rs +++ b/components/plurals/src/rules/parser.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use super::ast; use super::lexer::{Lexer, Token}; use std::fmt; diff --git a/components/plurals/src/rules/resolver.rs b/components/plurals/src/rules/resolver.rs index 89edc44ae97..42462e03108 100644 --- a/components/plurals/src/rules/resolver.rs +++ b/components/plurals/src/rules/resolver.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use super::ast; use crate::operands::PluralOperands; diff --git a/components/plurals/src/rules/serializer.rs b/components/plurals/src/rules/serializer.rs index 2ce26543875..5dad2e370d3 100644 --- a/components/plurals/src/rules/serializer.rs +++ b/components/plurals/src/rules/serializer.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::rules::ast; use std::fmt; use std::ops::RangeInclusive; diff --git a/components/plurals/tests/fixtures/mod.rs b/components/plurals/tests/fixtures/mod.rs index 0d6e663f851..5e005627069 100644 --- a/components/plurals/tests/fixtures/mod.rs +++ b/components/plurals/tests/fixtures/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use fixed_decimal::FixedDecimal; use icu_plurals::PluralOperands; use serde::Deserialize; diff --git a/components/plurals/tests/helpers.rs b/components/plurals/tests/helpers.rs index 546b2a3d2dc..d250c510c59 100644 --- a/components/plurals/tests/helpers.rs +++ b/components/plurals/tests/helpers.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::fs::File; use std::io::{BufReader, Error}; diff --git a/components/plurals/tests/operands.rs b/components/plurals/tests/operands.rs index 28c19cf993e..697ea382af2 100644 --- a/components/plurals/tests/operands.rs +++ b/components/plurals/tests/operands.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; mod helpers; diff --git a/components/plurals/tests/rules.rs b/components/plurals/tests/rules.rs index bb19da7e44f..120a9e9d796 100644 --- a/components/plurals/tests/rules.rs +++ b/components/plurals/tests/rules.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod fixtures; mod helpers; diff --git a/components/provider/Cargo.toml b/components/provider/Cargo.toml index 83757920ec9..b3b58122bdf 100644 --- a/components/provider/Cargo.toml +++ b/components/provider/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_provider" description = "Trait and struct definitions for the ICU data provider" diff --git a/components/provider/src/lib.rs b/components/provider/src/lib.rs index b9a44e280ed..58960b3c6d2 100644 --- a/components/provider/src/lib.rs +++ b/components/provider/src/lib.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `icu_provider` is one of the [`ICU4X`] components. //! //! It defines traits and structs for transmitting data through the ICU4X locale data pipeline. diff --git a/components/provider/tests/sizes.rs b/components/provider/tests/sizes.rs index ebba2f599d3..f2377eea994 100644 --- a/components/provider/tests/sizes.rs +++ b/components/provider/tests/sizes.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use icu_provider::prelude::*; use static_assertions::const_assert_eq; diff --git a/components/provider_cldr/Cargo.toml b/components/provider_cldr/Cargo.toml index 49853b67259..5049d50e237 100644 --- a/components/provider_cldr/Cargo.toml +++ b/components/provider_cldr/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_provider_cldr" description = "Data provider that reads from a CLDR JSON data source" diff --git a/components/provider_cldr/src/cldr_langid.rs b/components/provider_cldr/src/cldr_langid.rs index 84a26476395..bf51e6e0db5 100644 --- a/components/provider_cldr/src/cldr_langid.rs +++ b/components/provider_cldr/src/cldr_langid.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use icu_locid::LanguageIdentifier; use serde::{Deserialize, Deserializer}; use std::str::FromStr; diff --git a/components/provider_cldr/src/cldr_paths.rs b/components/provider_cldr/src/cldr_paths.rs index 650f8d89ad2..5aa32f75a77 100644 --- a/components/provider_cldr/src/cldr_paths.rs +++ b/components/provider_cldr/src/cldr_paths.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::error::{Error, MissingSourceError}; use std::default::Default; use std::path::PathBuf; diff --git a/components/provider_cldr/src/download/error.rs b/components/provider_cldr/src/download/error.rs index bb5551f6dfc..0c17dfff1d3 100644 --- a/components/provider_cldr/src/download/error.rs +++ b/components/provider_cldr/src/download/error.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::error; use std::fmt; use std::io; diff --git a/components/provider_cldr/src/download/io_util.rs b/components/provider_cldr/src/download/io_util.rs index c9b0ce41962..1e5dd2a2701 100644 --- a/components/provider_cldr/src/download/io_util.rs +++ b/components/provider_cldr/src/download/io_util.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use super::error::Error; use std::fs::{self, File}; use std::path::{Path, PathBuf}; diff --git a/components/provider_cldr/src/error.rs b/components/provider_cldr/src/error.rs index 7dc33fd1931..9d39699cfc4 100644 --- a/components/provider_cldr/src/error.rs +++ b/components/provider_cldr/src/error.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::error; use std::fmt; use std::path::{Path, PathBuf}; diff --git a/components/provider_cldr/src/lib.rs b/components/provider_cldr/src/lib.rs index 5de2acc96b1..74f21033c6d 100644 --- a/components/provider_cldr/src/lib.rs +++ b/components/provider_cldr/src/lib.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `icu_provider_cldr` is one of the [`ICU4X`] components. //! //! It contains implementations of the [`DataProvider`] interface based on the JSON files diff --git a/components/provider_cldr/src/reader.rs b/components/provider_cldr/src/reader.rs index 3b3e9c3aada..c904b984eaa 100644 --- a/components/provider_cldr/src/reader.rs +++ b/components/provider_cldr/src/reader.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::error::Error; use std::fs; use std::fs::File; diff --git a/components/provider_cldr/src/support.rs b/components/provider_cldr/src/support.rs index b70d81582e2..9642943018c 100644 --- a/components/provider_cldr/src/support.rs +++ b/components/provider_cldr/src/support.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::CldrPaths; use icu_provider::erased::*; use icu_provider::iter::{IterableDataProviderCore, KeyedDataProvider}; diff --git a/components/provider_cldr/src/transform/likelysubtags.rs b/components/provider_cldr/src/transform/likelysubtags.rs index 695e49dee92..f297fb34f65 100644 --- a/components/provider_cldr/src/transform/likelysubtags.rs +++ b/components/provider_cldr/src/transform/likelysubtags.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::error::Error; use crate::reader::open_reader; use crate::CldrPaths; diff --git a/components/provider_cldr/src/transform/mod.rs b/components/provider_cldr/src/transform/mod.rs index aa6802f06bf..b620d2752d2 100644 --- a/components/provider_cldr/src/transform/mod.rs +++ b/components/provider_cldr/src/transform/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + mod dates; mod likelysubtags; mod plurals; diff --git a/components/provider_cldr/src/transform/plurals.rs b/components/provider_cldr/src/transform/plurals.rs index e5014df6b6b..00cbda93cac 100644 --- a/components/provider_cldr/src/transform/plurals.rs +++ b/components/provider_cldr/src/transform/plurals.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::error::Error; use crate::reader::open_reader; use crate::CldrPaths; diff --git a/components/provider_fs/Cargo.toml b/components/provider_fs/Cargo.toml index 4d2f3521882..4467be7387e 100644 --- a/components/provider_fs/Cargo.toml +++ b/components/provider_fs/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_provider_fs" description = "ICU4X data provider that reads from structured data files" diff --git a/components/provider_fs/src/bin/icu4x-cldr-export.rs b/components/provider_fs/src/bin/icu4x-cldr-export.rs index b5e2fd6e971..b560c62dba8 100644 --- a/components/provider_fs/src/bin/icu4x-cldr-export.rs +++ b/components/provider_fs/src/bin/icu4x-cldr-export.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::manifest::LocalesOption; use clap::{App, Arg, ArgGroup}; use icu_locid::LanguageIdentifier; diff --git a/components/provider_fs/src/deserializer.rs b/components/provider_fs/src/deserializer.rs index 381111f2916..6215753aef2 100644 --- a/components/provider_fs/src/deserializer.rs +++ b/components/provider_fs/src/deserializer.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::manifest::SyntaxOption; use icu_provider::prelude::*; use icu_provider::serde::SerdeDeDataReceiver; diff --git a/components/provider_fs/src/error.rs b/components/provider_fs/src/error.rs index e2ce16a362a..e717cc6497b 100644 --- a/components/provider_fs/src/error.rs +++ b/components/provider_fs/src/error.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::manifest::SyntaxOption; use std::fmt; use std::path::{Path, PathBuf}; diff --git a/components/provider_fs/src/export/fs_exporter.rs b/components/provider_fs/src/export/fs_exporter.rs index e59e40339f4..128b846a833 100644 --- a/components/provider_fs/src/export/fs_exporter.rs +++ b/components/provider_fs/src/export/fs_exporter.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use super::aliasing::{self, AliasCollection}; use super::serializers::AbstractSerializer; use crate::error::Error; diff --git a/components/provider_fs/src/export/mod.rs b/components/provider_fs/src/export/mod.rs index 83c31bb150e..6db02de2119 100644 --- a/components/provider_fs/src/export/mod.rs +++ b/components/provider_fs/src/export/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! The `export` feature enables you to pull all data from some other data provider and persist it //! on the filesystem to be read by an FsDataProvider at runtime. //! diff --git a/components/provider_fs/src/export/serializers/bincode.rs b/components/provider_fs/src/export/serializers/bincode.rs index f5b2283828f..d62ae0f4316 100644 --- a/components/provider_fs/src/export/serializers/bincode.rs +++ b/components/provider_fs/src/export/serializers/bincode.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use super::AbstractSerializer; use super::Error; use crate::manifest::SyntaxOption; diff --git a/components/provider_fs/src/export/serializers/json.rs b/components/provider_fs/src/export/serializers/json.rs index 3a3e344b72e..13b073395e2 100644 --- a/components/provider_fs/src/export/serializers/json.rs +++ b/components/provider_fs/src/export/serializers/json.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use super::AbstractSerializer; use super::Error; use crate::manifest::SyntaxOption; diff --git a/components/provider_fs/src/export/serializers/mod.rs b/components/provider_fs/src/export/serializers/mod.rs index bb13aac9bca..59fd8839d58 100644 --- a/components/provider_fs/src/export/serializers/mod.rs +++ b/components/provider_fs/src/export/serializers/mod.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + pub mod json; #[cfg(feature = "bincode")] diff --git a/components/provider_fs/src/fs_data_provider.rs b/components/provider_fs/src/fs_data_provider.rs index 0bdca1bb458..a848435bfa9 100644 --- a/components/provider_fs/src/fs_data_provider.rs +++ b/components/provider_fs/src/fs_data_provider.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use crate::deserializer; use crate::error::Error; use crate::manifest::Manifest; diff --git a/components/provider_fs/src/lib.rs b/components/provider_fs/src/lib.rs index a2879cb9e3d..55a80417c22 100644 --- a/components/provider_fs/src/lib.rs +++ b/components/provider_fs/src/lib.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `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 diff --git a/components/provider_fs/src/manifest.rs b/components/provider_fs/src/manifest.rs index f021abfca6b..6d930da412d 100644 --- a/components/provider_fs/src/manifest.rs +++ b/components/provider_fs/src/manifest.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use icu_locid::LanguageIdentifier; use serde::{Deserialize, Serialize}; diff --git a/components/provider_ppucd/src/error.rs b/components/provider_ppucd/src/error.rs index 61ec14e0460..44404a5815a 100644 --- a/components/provider_ppucd/src/error.rs +++ b/components/provider_ppucd/src/error.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::fmt; #[derive(Debug)] diff --git a/components/provider_ppucd/src/parse_ppucd.rs b/components/provider_ppucd/src/parse_ppucd.rs index 5e06f84bb14..1914ea5ec5b 100644 --- a/components/provider_ppucd/src/parse_ppucd.rs +++ b/components/provider_ppucd/src/parse_ppucd.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::collections::{HashMap, HashSet}; use std::iter::Iterator; use std::u32; diff --git a/components/provider_ppucd/tests/props_test.rs b/components/provider_ppucd/tests/props_test.rs index 58f66f6ad07..5577199f68c 100644 --- a/components/provider_ppucd/tests/props_test.rs +++ b/components/provider_ppucd/tests/props_test.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + #![allow(clippy::unreadable_literal, dead_code)] use icu_provider_ppucd::support::*; diff --git a/components/uniset/Cargo.toml b/components/uniset/Cargo.toml index 63ae62b3c79..a1eeb421a2c 100644 --- a/components/uniset/Cargo.toml +++ b/components/uniset/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_uniset" description = "API for highly efficient querying of sets of Unicode characters" diff --git a/components/uniset/benches/inv_list.rs b/components/uniset/benches/inv_list.rs index ee6f5a44bd6..39ce26a09a6 100644 --- a/components/uniset/benches/inv_list.rs +++ b/components/uniset/benches/inv_list.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use criterion::{criterion_group, criterion_main, Criterion}; use icu_uniset::UnicodeSet; use std::char; diff --git a/components/uniset/examples/unicode_bmp_blocks_selector.rs b/components/uniset/examples/unicode_bmp_blocks_selector.rs index 9c5b919f40c..42b29ec922d 100644 --- a/components/uniset/examples/unicode_bmp_blocks_selector.rs +++ b/components/uniset/examples/unicode_bmp_blocks_selector.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + // An example application which uses icu_uniset to test what blocks of // Basic Multilingual Plane a character belongs to. // diff --git a/components/uniset/src/builder.rs b/components/uniset/src/builder.rs index c050703bea4..b4cf5925441 100644 --- a/components/uniset/src/builder.rs +++ b/components/uniset/src/builder.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::{char, cmp::Ordering, ops::RangeBounds}; use crate::{uniset::UnicodeSet, utils::deconstruct_range}; diff --git a/components/uniset/src/conversions.rs b/components/uniset/src/conversions.rs index bac6b0f33e4..df3ee3758f8 100644 --- a/components/uniset/src/conversions.rs +++ b/components/uniset/src/conversions.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::{ convert::TryFrom, ops::{Range, RangeBounds, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive}, diff --git a/components/uniset/src/lib.rs b/components/uniset/src/lib.rs index ab3218239cf..e3194007a31 100644 --- a/components/uniset/src/lib.rs +++ b/components/uniset/src/lib.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `icu_uniset` is one of the [`ICU4X`] components. //! //! This API provides necessary functionality for highly efficient querying of sets of Unicode characters. diff --git a/components/uniset/src/props.rs b/components/uniset/src/props.rs index 25f67180212..9a43f81d4f7 100644 --- a/components/uniset/src/props.rs +++ b/components/uniset/src/props.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + #![allow(clippy::unreadable_literal, dead_code)] use crate::provider::*; diff --git a/components/uniset/src/uniset.rs b/components/uniset/src/uniset.rs index 22890ea0bcf..3b74b8f32b2 100644 --- a/components/uniset/src/uniset.rs +++ b/components/uniset/src/uniset.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::{char, ops::RangeBounds, slice::Chunks}; use super::UnicodeSetError; diff --git a/components/uniset/src/utils.rs b/components/uniset/src/utils.rs index ae219eb8a35..e31d2de5a54 100644 --- a/components/uniset/src/utils.rs +++ b/components/uniset/src/utils.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::{ char, ops::{Bound::*, RangeBounds}, diff --git a/experimental/segmenter_lstm/Cargo.toml b/experimental/segmenter_lstm/Cargo.toml index 3832ee10e2d..15a13d42516 100644 --- a/experimental/segmenter_lstm/Cargo.toml +++ b/experimental/segmenter_lstm/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_segmenter_lstm" description = "LSTM-based segmenter for dictionary-based languages" diff --git a/resources/testdata/Cargo.toml b/resources/testdata/Cargo.toml index 143ccb11525..f1196b11c47 100644 --- a/resources/testdata/Cargo.toml +++ b/resources/testdata/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_testdata" description = "Test data for ICU4X, generated from CLDR" diff --git a/resources/testdata/src/bin/icu4x-gen-testdata.rs b/resources/testdata/src/bin/icu4x-gen-testdata.rs index 62b8480a397..8af4cd979ca 100644 --- a/resources/testdata/src/bin/icu4x-gen-testdata.rs +++ b/resources/testdata/src/bin/icu4x-gen-testdata.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use clap::{App, Arg, ArgMatches}; use icu_provider::export::DataExporter; use icu_provider_cldr::download::CldrAllInOneDownloader; diff --git a/resources/testdata/src/lib.rs b/resources/testdata/src/lib.rs index 06d3c5e5266..3a50f46e89d 100644 --- a/resources/testdata/src/lib.rs +++ b/resources/testdata/src/lib.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `icu_testdata` is a unit testing package for [`ICU4X`]. //! //! The package exposes a `DataProvider` with stable data useful for unit testing. The data is diff --git a/resources/testdata/src/metadata.rs b/resources/testdata/src/metadata.rs index 24d8b30000a..79d186bdd3d 100644 --- a/resources/testdata/src/metadata.rs +++ b/resources/testdata/src/metadata.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use cargo_metadata::{self, MetadataCommand}; use icu_locid::LanguageIdentifier; use serde::Deserialize; diff --git a/resources/testdata/src/test_data_provider.rs b/resources/testdata/src/test_data_provider.rs index 063ff3ef671..6409fa558ab 100644 --- a/resources/testdata/src/test_data_provider.rs +++ b/resources/testdata/src/test_data_provider.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use icu_provider_fs::FsDataProvider; use std::path::PathBuf; diff --git a/tools/benchmark/macros/Cargo.toml b/tools/benchmark/macros/Cargo.toml index 3ae20f8c6c2..181293c277a 100644 --- a/tools/benchmark/macros/Cargo.toml +++ b/tools/benchmark/macros/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_benchmark_macros" authors = ["The ICU4X Project Developers"] diff --git a/tools/benchmark/memory/Cargo.toml b/tools/benchmark/memory/Cargo.toml index ef92852e6f8..bbda3401102 100644 --- a/tools/benchmark/memory/Cargo.toml +++ b/tools/benchmark/memory/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "icu_benchmark_memory" authors = ["The ICU4X Project Developers"] diff --git a/tools/benchmark/memory/src/main.rs b/tools/benchmark/memory/src/main.rs index 0cb188e1f80..2fcffb46335 100644 --- a/tools/benchmark/memory/src/main.rs +++ b/tools/benchmark/memory/src/main.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use cargo_metadata::Metadata; use clap::{App, Arg}; use serde_json::json; diff --git a/utils/fixed_decimal/Cargo.toml b/utils/fixed_decimal/Cargo.toml index 1988a3771c1..9c4a2dd992f 100644 --- a/utils/fixed_decimal/Cargo.toml +++ b/utils/fixed_decimal/Cargo.toml @@ -1,6 +1,7 @@ # This file is part of ICU4X. For terms of use, please see the file # called LICENSE at the top level of the ICU4X source tree # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + [package] name = "fixed_decimal" description = "An API for representing numbers in a human-readable form" diff --git a/utils/fixed_decimal/benches/fixed_decimal.rs b/utils/fixed_decimal/benches/fixed_decimal.rs index 7e5f2e24b1f..e79769b0b18 100644 --- a/utils/fixed_decimal/benches/fixed_decimal.rs +++ b/utils/fixed_decimal/benches/fixed_decimal.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use rand::SeedableRng; use rand_distr::{Distribution, Triangular}; use rand_pcg::Lcg64Xsh32; diff --git a/utils/fixed_decimal/examples/permyriad.rs b/utils/fixed_decimal/examples/permyriad.rs index 4c30e9a57b6..e5c55ea3423 100644 --- a/utils/fixed_decimal/examples/permyriad.rs +++ b/utils/fixed_decimal/examples/permyriad.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + // In computers, monetary values are sometimes stored as integers representing one ten-thousandth // (one permyriad) of a monetary unit. FixedDecimal enables a cheap representation of these // amounts, also while retaining trailing zeros. diff --git a/utils/fixed_decimal/src/decimal.rs b/utils/fixed_decimal/src/decimal.rs index 551706e6d19..674fe71e56a 100644 --- a/utils/fixed_decimal/src/decimal.rs +++ b/utils/fixed_decimal/src/decimal.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use smallvec::SmallVec; use std::cmp; diff --git a/utils/fixed_decimal/src/lib.rs b/utils/fixed_decimal/src/lib.rs index 31216b60095..c4152564146 100644 --- a/utils/fixed_decimal/src/lib.rs +++ b/utils/fixed_decimal/src/lib.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + //! `fixed_decimal` is a utility crate of the [`ICU4X`] project. //! //! It includes [`FixedDecimal`], a core API for representing numbers in a human-readable form diff --git a/utils/fixed_decimal/src/uint_iterator.rs b/utils/fixed_decimal/src/uint_iterator.rs index fcf75ad994f..cc40645a88a 100644 --- a/utils/fixed_decimal/src/uint_iterator.rs +++ b/utils/fixed_decimal/src/uint_iterator.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + /// An iterator over the decimal digits of an integer, from least to most significant pub struct IntIterator { /// Digits remaining to be returned from the iterator diff --git a/utils/writeable/benches/writeable.rs b/utils/writeable/benches/writeable.rs index 5fbb5c86d97..9de43ee72d4 100644 --- a/utils/writeable/benches/writeable.rs +++ b/utils/writeable/benches/writeable.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use criterion::{black_box, criterion_group, criterion_main, Criterion}; use std::fmt; use writeable::LengthHint; diff --git a/utils/writeable/tests/writeable.rs b/utils/writeable/tests/writeable.rs index af78f132772..9203e24e027 100644 --- a/utils/writeable/tests/writeable.rs +++ b/utils/writeable/tests/writeable.rs @@ -1,6 +1,7 @@ // This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + use std::fmt; use writeable::assert_writeable_eq; use writeable::LengthHint;