set default path separator to '/' in MSYS#730
Conversation
b7517f1 to
454f411
Compare
|
bah, MSRV strikes again - no Result::as_deref() until 1.47. Should be fixed now |
| } else { | ||
| None | ||
| } | ||
| } |
There was a problem hiding this comment.
Maybe we could move this function to src/filesystem.rs?
|
Thank you very much! This looks great. I added a minor inline comment.
I'm usually also very open to bumping the MSRV, but it doesn't seem to bad here to still support 1.40. |
MSYS and MSYS2 environments (such as Git Bash) have a UNIX like filesystem which uses '/' as the path separator rather than '\', but Rust doesn't know about this by default. On Windows, check the MSYSTEM environment variable and set the default value of the --path-separator option to '/' for convenience. There is no similar detection of Cygwin because there seems to be no way for Rust (and any native Win32) programs to detect that they're being called from a Cygwin environment. Cygwin users can use a shell alias/function/script to wrap fd. Fixes: sharkdp#537
454f411 to
c7e5873
Compare
Yeah, it's no trouble to support 1.40 in this case, I'm just consistently surprised at how new of Rust features I use without even noticing (until CI fails) |
If you want, rustup/cargo make it rather easy to have multiple Rust chains in parallel: rustup toolchain install 1.40and then: |
MSYS and MSYS2 environments (such as Git Bash) have a UNIX like
filesystem which uses '/' as the path separator rather than '', but
Rust doesn't know about this by default.
On Windows, check the MSYSTEM environment variable and set the default
value of the --path-separator option to '/' for convenience.
There is no similar detection of Cygwin because there seems to be no way
for Rust (and any native Win32) programs to detect that they're being
called from a Cygwin environment. Cygwin users can use a shell
alias/function/script to wrap fd.
Fixes: #537