Skip to content

Commit

Permalink
Use create instead open to create the output file in serde exam…
Browse files Browse the repository at this point in the history
…ple.
  • Loading branch information
cryscan committed Jan 25, 2025
1 parent 25fa7bf commit cad0c15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ where
}

if let Some(output) = output {
let file = FileWriter(std::fs::File::open(output)?);
let file = FileWriter(std::fs::File::create(output)?);
let mut serializer = cbor4ii::serde::Serializer::new(file);

model.serialize(&mut serializer)?;
Expand Down

0 comments on commit cad0c15

Please sign in to comment.