-
-
Notifications
You must be signed in to change notification settings - Fork 844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
src/main.rs
Outdated
} else { | ||
None | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could move this function to src/filesystem.rs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
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.40 and 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