Skip to content

Commit

Permalink
refactor: use File::create() as create_new() has not been stabilized …
Browse files Browse the repository at this point in the history
…in 1.76 (#13)
  • Loading branch information
SteveLauC authored Oct 4, 2024
1 parent f250aa0 commit a8508ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cli_opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ mod tests {
let root_tempdir_path = root_tempdir.path();

let file_foo = root_tempdir_path.join("foo");
std::fs::File::create_new(&file_foo).unwrap();
std::fs::File::create(&file_foo).unwrap();
let file_bar_rs = root_tempdir_path.join("bar.rs");
std::fs::File::create_new(&file_bar_rs).unwrap();
std::fs::File::create(&file_bar_rs).unwrap();
let dir_baz = root_tempdir_path.join("baz");
std::fs::create_dir(&dir_baz).unwrap();
let file_qux_rs_under_dir_baz = dir_baz.join("qux.rs");
std::fs::File::create_new(&file_qux_rs_under_dir_baz).unwrap();
std::fs::File::create(&file_qux_rs_under_dir_baz).unwrap();

let cli = Cli {
// This field won't be used so let's give it a NULL value
Expand All @@ -122,7 +122,7 @@ mod tests {
);

let file_quux_rs_under_dir_baz = dir_baz.join("quux");
std::fs::File::create_new(&file_quux_rs_under_dir_baz).unwrap();
std::fs::File::create(&file_quux_rs_under_dir_baz).unwrap();

let flattened = cli.rust_src_to_check();
assert_eq!(
Expand Down

0 comments on commit a8508ba

Please sign in to comment.