Skip to content

Commit

Permalink
Remove dependency on filetime crate
Browse files Browse the repository at this point in the history
Android doesn't have the filetime crate vendored into the tree, but
as of rust 1.75, the standard library has the ability to change
filetimes.
  • Loading branch information
Colecf authored and evmar committed May 2, 2024
1 parent 8881a66 commit 15a580d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@1.70.0
- uses: dtolnay/rust-toolchain@1.75.0
with:
components: rustfmt
- name: Check formatting
Expand Down
120 changes: 16 additions & 104 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ readme = "README.md"
repository = "https://github.com/evmar/n2"
# https://github.com/evmar/n2/issues/74
# Note: if we bump this, may need to bump .github/workflows/ci.yml version too.
rust-version = "1.70.0"
rust-version = "1.75.0"
description = "a ninja compatible build system"

[dependencies]
Expand All @@ -37,7 +37,6 @@ jemallocator = "0.5.0"
[dev-dependencies]
tempfile = "3.6.0"
criterion = { version = "0.5.1", features = ["html_reports"] }
filetime = "0.2"

[profile.release]
debug = true
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ impl TestSpace {
pub fn sub_mtime(&self, path: &str, dur: std::time::Duration) -> anyhow::Result<()> {
let path = self.dir.path().join(path);
let t = std::time::SystemTime::now() - dur;
filetime::set_file_mtime(path, filetime::FileTime::from_system_time(t))?;
let f = std::fs::File::options().write(true).open(path)?;
f.set_modified(t)?;
Ok(())
}

Expand Down

0 comments on commit 15a580d

Please sign in to comment.