Skip to content

Commit

Permalink
Refactor ICU4X code to allow configured code by version (unicode-org#377
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sffc authored Jan 8, 2025
1 parent 5b47f49 commit 2480e06
Show file tree
Hide file tree
Showing 36 changed files with 284 additions and 1,166 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/run-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.73
toolchain: "1.80"
components: rustfmt, clippy
default: true
- uses: actions-rs/cargo@v1
Expand All @@ -31,4 +31,8 @@ jobs:
with:
command: fmt
args: --manifest-path executors/rust/${{ matrix.icu4x-version }}/Cargo.toml -- --check
- name: "Run Rustfmt (executor code)"
run: rustfmt executors/rust/src/** --check
- name: "Run Rustfmt (common code)"
run: rustfmt executors/rust/common/** --check

6 changes: 1 addition & 5 deletions executors/rust/1.3/build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
// Getting the version of ICU4X

#[path = "../common/print_icu4x_versions_1_3.rs"]
mod print_icu4x_versions_1_3;

fn main() {
print_icu4x_versions_1_3::print();
}
use print_icu4x_versions_1_3::main;
47 changes: 0 additions & 47 deletions executors/rust/1.3/src/collator.rs

This file was deleted.

38 changes: 0 additions & 38 deletions executors/rust/1.3/src/decimalfmt.rs

This file was deleted.

27 changes: 0 additions & 27 deletions executors/rust/1.3/src/displaynames.rs

This file was deleted.

50 changes: 0 additions & 50 deletions executors/rust/1.3/src/likelysubtags.rs

This file was deleted.

94 changes: 0 additions & 94 deletions executors/rust/1.3/src/listfmt.rs

This file was deleted.

38 changes: 1 addition & 37 deletions executors/rust/1.3/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
// Read JSON test case from standard in.
// Parse to get test and parameters
// Run test
// Return results

use std::io;

mod icu {
pub use ::icu::compactdecimal;
pub use ::icu::displaynames;
pub use ::icu::relativetime;
}

mod collator;
mod datetimefmt;
mod decimalfmt;
mod displaynames;
mod likelysubtags;
mod listfmt;
mod localenames;
mod numberfmt;
mod pluralrules;
mod relativedatetime_fmt;

#[path = "../../common/run_all_tests.rs"]
mod run_all_tests;

fn main() -> io::Result<()> {
let executor_fns = run_all_tests::ExecutorFns {
run_collation_test: collator::run_collation_test,
run_datetimeformat_test: datetimefmt::run_datetimeformat_test,
run_likelysubtags_test: likelysubtags::run_likelysubtags_test,
run_list_fmt_test: listfmt::run_list_fmt_test,
run_locale_name_test: localenames::run_locale_name_test,
run_numberformat_test: numberfmt::run_numberformat_test,
run_plural_rules_test: pluralrules::run_plural_rules_test,
run_relativedatetimeformat_test: relativedatetime_fmt::run_relativedatetimeformat_test,
};
run_all_tests::main(executor_fns)
}
use run_all_tests::main;
Loading

0 comments on commit 2480e06

Please sign in to comment.