Skip to content

Commit f51623b

Browse files
committed
Fix breakage from v0.3.38
1 parent 1a31c05 commit f51623b

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

.github/workflows/build.yaml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ env:
1818
"x86_64-unknown-linux-gnu",
1919
"x86_64-apple-darwin",
2020
"x86_64-pc-windows-gnu"
21+
],
22+
"wasm": [
23+
"wasm32-unknown-unknown"
2124
]
2225
}'
2326

@@ -58,22 +61,32 @@ jobs:
5861
query: .no_std + .std_no_offset + .std_with_offset
5962
exclude-features:
6063
- std
64+
- wasm-bindgen
6165
- formatting
6266
- serde-human-readable
6367
- serde-well-known
6468
- local-offset
6569
- quickcheck
66-
group-features: []
70+
group-features:
71+
- [serde, rand]
6772
- name: std_no_offset
6873
query: .std_no_offset + .std_with_offset
69-
exclude-features: [local-offset]
74+
exclude-features: [wasm-bindgen, local-offset]
7075
enable-features: [std]
7176
group-features:
77+
- [serde, rand]
7278
- [formatting, parsing]
7379
- [serde-human-readable, serde-well-known]
7480
- name: std_with_offset
7581
query: .std_with_offset
76-
enable-features: [std, local-offset]
82+
enable-features: [wasm-bindgen, std, local-offset]
83+
group-features:
84+
- [serde, rand]
85+
- [formatting, parsing]
86+
- [serde-human-readable, serde-well-known]
87+
- name: wasm
88+
query: .wasm
89+
exclude-features: [rand, quickcheck, local-offset]
7790
group-features:
7891
- [formatting, parsing]
7992
- [serde-human-readable, serde-well-known]
@@ -115,8 +128,7 @@ jobs:
115128
--no-dev-deps \
116129
--feature-powerset \
117130
--optional-deps \
118-
--group-features serde,rand \
119-
--exclude-features default,wasm-bindgen,${{ join(matrix.kind.exclude-features) }} \
131+
--exclude-features default,${{ join(matrix.kind.exclude-features) }} \
120132
--features macros,${{ join(matrix.kind.enable-features) }} \
121133
--exclude-all-features \
122134
)
@@ -169,6 +181,25 @@ jobs:
169181
- name: Test
170182
run: cargo test -p time --all-features
171183

184+
test-docs:
185+
name: Test (docs)
186+
runs-on: ubuntu-latest
187+
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) || github.event_name == 'push'
188+
189+
steps:
190+
- name: Checkout sources
191+
uses: actions/checkout@v4
192+
193+
- name: Cache cargo output
194+
uses: Swatinem/rust-cache@v2
195+
196+
- name: Install toolchain
197+
uses: dtolnay/rust-toolchain@stable
198+
199+
# Test with default feature set to prevent #735 from happening again.
200+
- name: Doc test
201+
run: cargo test -p time --doc
202+
172203
miri:
173204
name: Test (miri)
174205
runs-on: ubuntu-latest

.github/workflows/powerset.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ env:
2222
"x86_64-linux-android",
2323
"x86_64-unknown-netbsd",
2424
"x86_64-unknown-illumos"
25+
],
26+
"wasm": [
27+
"wasm32-unknown-unknown"
2528
]
2629
}'
2730

@@ -56,18 +59,23 @@ jobs:
5659
query: .no_std + .std_no_offset + .std_with_offset
5760
exclude_features:
5861
- std
62+
- wasm-bindgen
5963
- local-offset
6064
- quickcheck
6165
- formatting
6266
- serde-human-readable
6367
- serde-well-known
6468
- name: std_no_offset
6569
query: .std_no_offset + .std_with_offset
66-
exclude_features: [local-offset]
70+
exclude_features: [local-offset, wasm-bindgen]
6771
enable_features: [std]
6872
- name: std_with_offset
6973
query: .std_with_offset
74+
exclude_features: [wasm-bindgen]
7075
enable_features: [std, local-offset]
76+
- name: wasm
77+
query: .wasm
78+
exclude_features: [rand, quickcheck, local-offset]
7179

7280
steps:
7381
- name: Checkout sources
@@ -97,7 +105,7 @@ jobs:
97105
--no-dev-deps \
98106
--feature-powerset \
99107
--optional-deps \
100-
--exclude-features default,wasm-bindgen,${{ join(matrix.kind.exclude_features) }} ${{
108+
--exclude-features default,${{ join(matrix.kind.exclude_features) }} ${{
101109
matrix.kind.enable_features && format('--features {0}', join(matrix.kind.enable_features)) }}
102110
103111
release:

time/src/offset_date_time.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,14 @@ impl OffsetDateTime {
269269
/// 1999,
270270
/// );
271271
/// assert_eq!(
272-
/// datetime!(+999999-12-31 23:59:59 -1).checked_to_utc(),
272+
#[cfg_attr(
273+
feature = "large-dates",
274+
doc = " datetime!(+999999-12-31 23:59:59 -1).checked_to_utc(),"
275+
)]
276+
#[cfg_attr(
277+
not(feature = "large-dates"),
278+
doc = " datetime!(9999-12-31 23:59:59 -1).checked_to_utc(),"
279+
)]
273280
/// None,
274281
/// );
275282
/// ```

time/src/utc_date_time.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,8 @@ impl From<js_sys::Date> for UtcDateTime {
14041404
))]
14051405
impl From<UtcDateTime> for js_sys::Date {
14061406
fn from(datetime: UtcDateTime) -> Self {
1407+
use num_conv::prelude::*;
1408+
14071409
// new Date() takes milliseconds
14081410
let timestamp = (datetime.unix_timestamp_nanos()
14091411
/ Nanosecond::per(Millisecond).cast_signed().extend::<i128>())

0 commit comments

Comments
 (0)