render.rs icon indicating copy to clipboard operation
render.rs copied to clipboard

Use io::Write instead of fmt::Write

Open daaku opened this issue 4 years ago • 1 comments

From the docs of fmt::Write:

This trait is the type which this modules requires when formatting information. This is similar to the standard library's io::Write trait, but it is only intended for use in libcore.

This trait should generally not be implemented by consumers of the standard library. The write! macro accepts an instance of io::Write, and the io::Write trait is favored over implementing this trait.

I see there was some discussion in #8 but I think switching over to io::Write is the right call.

daaku avatar Jun 12 '20 12:06 daaku

That seems to have changed. The latest docs say:

This trait only accepts UTF-8–encoded data and is not flushable. If you only want to accept Unicode and you don’t need flushing, you should implement this trait; otherwise you should implement std::io::Write.

thomaseizinger avatar Nov 28 '22 08:11 thomaseizinger