dylanhart / ulid-rs

This is a Rust implementation of the ulid project
https://crates.io/crates/ulid
MIT License
389 stars 37 forks source link

web_time resolve error with --target wasm32-wasi #74

Closed optevo closed 10 months ago

optevo commented 10 months ago

I believe this just started happening on ulid 1.1.1 when I execute:

cargo build --target wasm32-wasi (compiles fine with cargo build --target wasm32-unknown-unknown)

error[E0433]: failed to resolve: use of undeclared crate or module `web_time`
 --> /Users/abc/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ulid-1.1.1/src/time_utils.rs:4:13
  |
4 |         use web_time::web::SystemTimeExt;
  |             ^^^^^^^^ use of undeclared crate or module `web_time`

error[E0433]: failed to resolve: use of undeclared crate or module `web_time`
 --> /Users/abc/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ulid-1.1.1/src/time_utils.rs:5:16
  |
5 |         return web_time::SystemTime::now().to_std();
  |                ^^^^^^^^ use of undeclared crate or module `web_time`
  |
help: consider importing this struct
  |
1 + use std::time::SystemTime;
  |
help: if you import `SystemTime`, refer to it directly
  |
5 -         return web_time::SystemTime::now().to_std();
5 +         return SystemTime::now().to_std();
  |

For more information about this error, try `rustc --explain E0433`.
error: could not compile `ulid` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
dylanhart commented 10 months ago

Fixed in #73. Pushing v1.1.2

optevo commented 10 months ago

Thank you!