Skip to content

0.9 changes prevent to use a std::fs::File directly with to_writer and to_writer_pretty #561

@Ummon

Description

@Ummon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions