time-rs / time

The most used Rust library for date and time handling.
https://time-rs.github.io
Apache License 2.0
1.06k stars 261 forks source link

Compilation error for "wasm-bindgen" #652

Closed heeckhau closed 5 months ago

heeckhau commented 5 months ago

Compilation fails for cargo build --target wasm32-unknown-unknown --features "wasm-bindgen":

error[E0425]: cannot find value `Millisecond` in this scope
    --> time/src/offset_date_time.rs:1600:69
     |
1600 |         let timestamp_nanos = (js_date.get_time() * Nanosecond::per(Millisecond) as f64) as i128;
     |                                                                     ^^^^^^^^^^^ not found in this scope
     |
help: consider importing one of these items
     |
3    + use crate::convert::Millisecond;
     |
3    + use time_core::convert::Millisecond;
     |

error[E0425]: cannot find value `Millisecond` in this scope
    --> time/src/offset_date_time.rs:1615:31
     |
1615 |             / Nanosecond::per(Millisecond).cast_signed().extend::<i128>())
     |                               ^^^^^^^^^^^ not found in this scope
     |
help: consider importing one of these items
     |
3    + use crate::convert::Millisecond;
     |
3    + use time_core::convert::Millisecond;
     |

This worked fine in v0.3.31, but now fails for both v0.3.32 and main