overwrite output file by default

This commit is contained in:
Adam Macdonald 2025-04-08 20:01:43 +01:00
parent ff8ba4ae10
commit 039bfcc201
3 changed files with 4 additions and 3 deletions

2
Cargo.lock generated
View File

@ -54,7 +54,7 @@ dependencies = [
[[package]] [[package]]
name = "bin2hpp" name = "bin2hpp"
version = "0.1.0" version = "0.1.1"
dependencies = [ dependencies = [
"clap", "clap",
] ]

View File

@ -1,6 +1,6 @@
[package] [package]
name = "bin2hpp" name = "bin2hpp"
version = "0.1.0" version = "0.1.1"
authors = ["Adam Macdonald"] authors = ["Adam Macdonald"]
edition = "2024" edition = "2024"
license = "Unlicense" license = "Unlicense"

View File

@ -117,7 +117,8 @@ fn main() -> ExitCode {
let output_file = match OpenOptions::new() let output_file = match OpenOptions::new()
.write(true) .write(true)
.create_new(true) .truncate(true)
.create(true)
.open(output_path) .open(output_path)
{ {
Ok(f) => f, Ok(f) => f,