nushell/crates/nu-system/src
Piepmatz 4b1f4e63c3
Replace std::time::Instant with web_time::Instant (#14668)
# Description
The `std::time::Instant` type panics in the WASM context. To prevent
this, I replaced all uses of `std::time::Instant` in WASM-relevant
crates with `web_time::Instant`. This ensures commands using `Instant`
work in WASM without issues. For non-WASM targets, `web-time` simply
reexports `std::time`, so this change doesn’t affect regular builds
([docs](https://docs.rs/web-time/latest/web_time/)).

To ensure future code doesn't reintroduce `std::time::Instant` in WASM
contexts, I added a `clippy wasm` command to the toolkit. This runs
`cargo clippy` with a `clippy.toml` configured to disallow
`std::time::Instant`. Since `web-time` aliases `std::time` by default,
the `clippy.toml` is stored in `clippy/wasm` and is only loaded when
targeting WASM. I also added a new CI job that tests this too.

# User-Facing Changes

None.
2024-12-25 16:50:02 +08:00
..
exit_status.rs Fix handling of stopped TUI applications on unix (#13741) 2024-09-24 06:44:58 -05:00
foreground.rs Fix handling of stopped TUI applications on unix (#13741) 2024-09-24 06:44:58 -05:00
freebsd.rs fix nu-system build on arm64 FreeBSD (#13196) 2024-06-21 03:03:10 -07:00
lib.rs Fix handling of stopped TUI applications on unix (#13741) 2024-09-24 06:44:58 -05:00
linux.rs Prefer process name over executable path (#13618) 2024-08-15 13:44:01 +08:00
macos.rs add start_time to ps -l on macos (#14127) 2024-10-21 11:55:30 -05:00
netbsd.rs Add support for the ps command on FreeBSD, NetBSD, and OpenBSD (#12892) 2024-05-22 08:13:45 -07:00
os_info.rs Bump sysinfo from 0.29 to 0.30 (#11484) 2024-01-05 05:31:29 -06:00
windows.rs Replace std::time::Instant with web_time::Instant (#14668) 2024-12-25 16:50:02 +08:00