-
-
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
fix ~ touch: fix and test for windows #1319
Conversation
rivy
commented
Nov 26, 2018
- fix windows compilation
- enable testing windows
- re-categorize as "generic"
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.
Thanks for the changes. Really sorry it took so long to get back to you!
src/touch/touch.rs
Outdated
@@ -18,7 +18,9 @@ extern crate uucore; | |||
|
|||
use filetime::*; | |||
use std::fs::{self, File}; | |||
use std::io::{self, Error}; | |||
#[cfg(not(windows))] | |||
use std::io::{self}; |
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 can just be use std::io;
src/touch/touch.rs
Outdated
@@ -52,7 +55,7 @@ macro_rules! to_timeval { | |||
} | |||
|
|||
#[cfg(unix)] | |||
fn set_symlink_times(p: &str, atime: FileTime, mtime: FileTime) -> io::Result<()> { | |||
fn set_symlink_file_times(p: &str, atime: FileTime, mtime: FileTime) -> io::Result<()> { |
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.
I don't think this function as actually necessary even on Unix. set_symlink_file_times()
in filetime
seems to say it does the same thing.
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.
🛠 * both fixed
@Arcterus , I'll review and update the code this weekend. Thanks for getting back to it. |
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.
A couple more changes (should be good to go after this).
src/touch/touch.rs
Outdated
@@ -42,6 +44,7 @@ macro_rules! local_tm_to_filetime( | |||
}) | |||
); | |||
|
|||
#[cfg(unix)] |
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.
Because the other function is now gone, this macro actually isn't used anywhere now, so it can be deleted too.
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.
👍
src/touch/touch.rs
Outdated
use std::io::{self, Error}; | ||
#[cfg(not(windows))] | ||
use std::io; | ||
use std::io::{Error}; |
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.
Sorry, I missed this one. Can you remove the braces around Error
?
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.
👍
I squashed the code change and dead-code removal into a single commit. |
Looks good, thanks! |