ok/jj
1
0
Fork 0
forked from mirrors/jj

clippy: add truncate option as suggested by clippy

In the next commit, I replace the whole thing with
std::fs::write, but I'll leave this here in case
the next commit is somhow incorrect
This commit is contained in:
Ilya Grigoriev 2024-02-10 15:08:26 -08:00
parent a88c06068e
commit b2e37d448b

View file

@ -516,11 +516,11 @@ fn test_snapshot_racy_timestamps() {
let mut previous_tree_id = repo.store().empty_merged_tree_id();
for i in 0..100 {
{
// https://github.com/rust-lang/rust-clippy/issues/9778
#[allow(clippy::needless_borrow)]
// Short-term TODO: Switch to fs::write?
let mut file = OpenOptions::new()
.create(true)
.write(true)
.truncate(true)
.open(&file_path)
.unwrap();
file.write_all(format!("contents {i}").as_bytes()).unwrap();