Skip to content

Commit

Permalink
test_local_working_copy: use std::fs:write instead of OpenOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyagr committed Feb 11, 2024
1 parent b2e37d4 commit a9c3af8
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions lib/tests/test_local_working_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::fs::OpenOptions;
use std::io::Write;
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
#[cfg(unix)]
Expand Down Expand Up @@ -515,16 +513,7 @@ fn test_snapshot_racy_timestamps() {
let file_path = workspace_root.join("file");
let mut previous_tree_id = repo.store().empty_merged_tree_id();
for i in 0..100 {
{
// 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();
}
std::fs::write(&file_path, format!("contents {i}").as_bytes()).unwrap();
let mut locked_ws = test_workspace
.workspace
.start_working_copy_mutation()
Expand Down

0 comments on commit a9c3af8

Please sign in to comment.