-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improve readability #1571
Improve readability #1571
Conversation
@@ -341,7 +341,7 @@ mod tests { | |||
fn syntax_for_file_with_content_os(&self, file_name: &OsStr, first_line: &str) -> String { | |||
let file_path = self.temp_dir.path().join(file_name); | |||
let input = Input::from_reader(Box::new(BufReader::new(first_line.as_bytes()))) | |||
.with_name(Some(file_path.as_os_str())); | |||
.with_name(Some(&file_path)); |
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.
Note that here we don't need a conversion back from Path
.
.matches | ||
.values_of("file-name") | ||
.map(|values| values.collect()); | ||
.values_of_os("file-name") |
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.
This adds support for non-utf8 names
I haven't done a detailed review yet, but am in general positive to this change after skimming it through. I'm curious what problem you saw with non-UTF-8 file names though? Works OK for me at least, using official build of
|
@Enselic you need to check with the |
Thank you for your contribution! The changes look good. This is (at least technically) a breaking change, so it should be documented as such in the " |
Thanks, with
|
Using `Path`s for paths expresses intent more clearly.
Yeah, makes sense, updated! |
Using
Path
s for paths expresses intent more clearly.Drive by change mostly, I just accidentally fell into non-utf8 arguments pit :)