As to_writer and to_writer_pretty need a std::fmt::Write as writer it's not possible to give them a std::fs::File directly.
It was possible in 0.8 to do that:
let file = File::create("file.ron").unwrap();
to_writer(file, &my_ron);
But it's not possible anymore.
Is there an easy way to write directly to a file? If yes it should be great to have an example in /examples/ as the reader example /examples/decode_file.rs.
As
to_writerandto_writer_prettyneed astd::fmt::Writeas writer it's not possible to give them astd::fs::Filedirectly.It was possible in 0.8 to do that:
But it's not possible anymore.
Is there an easy way to write directly to a file? If yes it should be great to have an example in /examples/ as the reader example /examples/decode_file.rs.