Skip to content

Commit 79faa3e

Browse files
committed
Remove unneeded filetime dependency
1 parent ee91895 commit 79faa3e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

collector/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ intern = { path = "../intern" }
2828
futures = "0.3.5"
2929
jobserver = "0.1.21"
3030
snap = "1"
31-
filetime = "0.2.14"
3231
walkdir = "2"
3332
flate2 = { version = "1.0.22", features = ["rust_backend"] }
3433
rayon = "1.5.2"

collector/src/utils/fs.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ use anyhow::Context;
22
use std::collections::hash_map::DefaultHasher;
33
use std::ffi::OsStr;
44
use std::fs;
5+
use std::fs::File;
56
use std::hash::{Hash, Hasher};
67
use std::path::{Component, Path, PathBuf};
78
use std::process::Command;
9+
use std::time::SystemTime;
810

911
#[cfg(windows)]
1012
pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> anyhow::Result<()> {
@@ -43,7 +45,8 @@ pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> anyhow::Result<
4345

4446
/// Touch a file, resetting its modification time.
4547
pub fn touch(path: &Path) -> anyhow::Result<()> {
46-
filetime::set_file_mtime(path, filetime::FileTime::now())
48+
let file = File::options().read(true).open(path)?;
49+
file.set_modified(SystemTime::now())
4750
.with_context(|| format!("touching file {:?}", path))?;
4851

4952
Ok(())

0 commit comments

Comments
 (0)