Skip to content

Commit 289eb1b

Browse files
authored
Update to ICU4X's new Calendar::from_fields (#582)
This removes most of the ResolveCalendarFields code. I kept some around as ResolvedIsoFields since the ISO code is separately specced and we should not rely on ICU4X for that.
1 parent a36c2b6 commit 289eb1b

File tree

15 files changed

+384
-929
lines changed

15 files changed

+384
-929
lines changed

Cargo.lock

Lines changed: 149 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,22 @@ timezone_provider = { version = "~0.1.0", path = "./provider" }
3434
zoneinfo_rs = { version = "~0.0.17", path = "./zoneinfo" }
3535

3636
# Dependencies
37-
tinystr = "0.8.1"
38-
icu_calendar = { version = "2.0.3", default-features = false }
39-
icu_locale = "2.0.0"
37+
tinystr = { git = "https://github.com/unicode-org/icu4x", rev = "0f9fd3dd847a5a4682f7ec8a300555a7d761258c" }
38+
icu_calendar = { git = "https://github.com/unicode-org/icu4x", rev = "0f9fd3dd847a5a4682f7ec8a300555a7d761258c", default-features = false }
39+
icu_locale = { git = "https://github.com/unicode-org/icu4x", rev = "0f9fd3dd847a5a4682f7ec8a300555a7d761258c" }
4040
rustc-hash = "2.1.0"
4141
num-traits = { version = "0.2.19", default-features = false }
42-
ixdtf = "0.6.0"
42+
ixdtf = { git = "https://github.com/unicode-org/icu4x", rev = "0f9fd3dd847a5a4682f7ec8a300555a7d761258c" }
4343
iana-time-zone = "0.1.64"
4444
log = "0.4.28"
4545
tzif = "0.4.0"
4646
jiff-tzdb = "0.1.4"
4747
combine = "4.6.7"
4848
web-time = "1.1.0"
49-
zerovec = "0.11.4"
49+
zerovec = { git = "https://github.com/unicode-org/icu4x", rev = "0f9fd3dd847a5a4682f7ec8a300555a7d761258c" }
50+
databake = { git = "https://github.com/unicode-org/icu4x", rev = "0f9fd3dd847a5a4682f7ec8a300555a7d761258c" }
51+
zerotrie = { git = "https://github.com/unicode-org/icu4x", rev = "0f9fd3dd847a5a4682f7ec8a300555a7d761258c" }
52+
writeable = { git = "https://github.com/unicode-org/icu4x", rev = "0f9fd3dd847a5a4682f7ec8a300555a7d761258c" }
5053
zoneinfo64 = "0.2.0"
5154

5255
# Diplomat
@@ -77,7 +80,7 @@ icu_locale.workspace = true
7780
ixdtf = { workspace = true, features = ["duration"] }
7881
num-traits.workspace = true
7982
tinystr.workspace = true
80-
writeable = "0.6.1"
83+
writeable.workspace = true
8184

8285
# log feature
8386
log = { workspace = true, optional = true }

provider/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ zoneinfo64 = ["dep:zoneinfo64"]
5252
[dependencies]
5353

5454
# Provider dependency
55-
zerotrie = "0.2.2"
55+
zerotrie.workspace = true
5656
zerovec = { workspace = true, features = ["derive", "alloc"] }
5757
tinystr = { workspace = true, features = ["zerovec"] }
5858

@@ -69,7 +69,7 @@ zoneinfo64 = { workspace = true, optional = true }
6969

7070
# Databake dependencies
7171
serde = { version = "1.0.225", features = ["derive"], optional = true }
72-
databake = { version = "0.2.0", features = ["derive"], optional = true }
72+
databake = { workspace = true, optional = true, features = ["derive"]}
7373
yoke = { version = "0.8.0", features = ["derive"], optional = true }
7474
serde_json = { version = "1.0.145", optional = true }
7575

provider/src/experimental_tzif/posix.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ impl From<&PosixTransition> for ZeroPosixTransition {
7474
#[cfg_attr(feature = "datagen", databake(path = timezone_provider::experimental_tzif::posix))]
7575
pub struct ZeroTransitionDateTime {
7676
/// The date at which a transition should occur.
77-
date: ZeroTransitionDate,
77+
pub date: ZeroTransitionDate,
7878
/// The time of day in seconds.
79-
time: i64,
79+
pub time: i64,
8080
}
8181

8282
#[cfg(feature = "datagen")]
@@ -97,9 +97,9 @@ impl From<&PosixDateTime> for ZeroTransitionDateTime {
9797
)]
9898
#[cfg_attr(feature = "datagen", databake(path = timezone_provider::experimental_tzif::posix))]
9999
pub struct ZeroTransitionDate {
100-
kind: DateKind,
101-
day: Option<u16>,
102-
mwd: Option<(u8, u8, u8)>,
100+
pub kind: DateKind,
101+
pub day: Option<u16>,
102+
pub mwd: Option<(u8, u8, u8)>,
103103
}
104104

105105
#[cfg(feature = "datagen")]

0 commit comments

Comments
 (0)