Add alias File::set_modified
as shorthand
This commit is contained in:
parent
61b45c670b
commit
1ac8d5ece3
@ -638,6 +638,15 @@ impl File {
|
||||
pub fn set_times(&self, times: FileTimes) -> io::Result<()> {
|
||||
self.inner.set_times(times.0)
|
||||
}
|
||||
|
||||
/// Changes the modification time of the underlying file.
|
||||
///
|
||||
/// This is an alias for `set_times(FileTimes::new().set_modified(time))`.
|
||||
#[unstable(feature = "file_set_times", issue = "98245")]
|
||||
#[inline]
|
||||
pub fn set_modified(&self, time: SystemTime) -> io::Result<()> {
|
||||
self.set_times(FileTimes::new().set_modified(time))
|
||||
}
|
||||
}
|
||||
|
||||
// In addition to the `impl`s here, `File` also has `impl`s for
|
||||
|
Loading…
x
Reference in New Issue
Block a user