Skip to content

Commit

Permalink
Merge pull request #395 from Metaswitch/md/createtruncate
Browse files Browse the repository at this point in the history
Ensure clear options when touching a file
  • Loading branch information
maxdymond committed Mar 26, 2024
2 parents 43c36e7 + 8308813 commit 0c23d24
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ simplelog = "0.12"
nix = { version = "0.28", default-features = false, features = ["user"] }
shlex = "1.3"
sha2 = "0.10.8"
anyhow = "1.0.80"
anyhow = "1.0.81"
thiserror = "1.0.58"
tera = "1"
serde_json = "1.0.114"
Expand Down
6 changes: 5 additions & 1 deletion src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ mod test {
path.parent()
.ok_or_else(|| anyhow!("Unable to take parent of path"))?,
)?;
fs::OpenOptions::new().create(true).write(true).open(path)?;
fs::OpenOptions::new()
.truncate(false)
.create(true)
.write(true)
.open(path)?;
Ok(())
}

Expand Down

0 comments on commit 0c23d24

Please sign in to comment.