render.rs
render.rs copied to clipboard
Use io::Write instead of fmt::Write
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.
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.