fish-shell/fish-rust
Mahmoud Al-Qudsi 3a2033b992
Fix rust version of is_wsl() check (#9746)
Somewhat counter-intuitively, this code is active when compiling under *Linux*
and is always false when compiling under Windows. The logic was incorrectly
reversed before (it's easier to reason about when you realize that fish doesn't
even compile under Windows because it uses tons of libc functions).

As the code was actually never compiled, it wasn't actually tested for validity
either and there were some issues that prevented it from compiling that have
since been fixed. The logic has also been adjusted a bit to make it possible to
use the rust-native int parsing instead of `libc::strtod()`.

The code has been changed to use `once_cell::race::OnceBool` instead of
`once_cell::sync::Lazy<T>` which imposes a greater runtime burden with locking
and other overhead. We don't care if the code runs more than once on init (if
calls were to race, though they probably don't) - just that the code isn't
subsequently executed on each call. The `once_cell::race` module is a better fit
here, though it doesn't expose the ergonomic `Lazy<T>` façade around its types.
2023-04-23 12:28:23 -05:00
..
src Fix rust version of is_wsl() check (#9746) 2023-04-23 12:28:23 -05:00
widestring-suffix Initial Rust commit 2023-02-02 19:34:47 -07:00
build.rs Port AST to Rust 2023-04-16 17:46:56 +02:00
Cargo.lock Env stubs for path port 2023-04-21 13:57:29 +02:00
Cargo.toml Env stubs for path port 2023-04-21 13:57:29 +02:00