Simple (and the most common, I believe) use case - you're implementing Display or Debug for your type containing some time objects, and you are provided with std::fmt::Formatter which implements std::fmt::Write trait. (maybe I'm missing something trivial, so apologies in advance if that's the case)
Current format_into implementations though require &mut impl std::io::Write which is a different beast, more complex and aimed at different stuff, with vectored writes, flushing and all the rest. If one were to choose between the two, wouldn't it make sense to support fmt::Write and not io::Write? Is there a clean alternative way?
(There's crates like fmt2io that provide hacky bridges but that's just ugly and wrong)
Simple (and the most common, I believe) use case - you're implementing
DisplayorDebugfor your type containing some time objects, and you are provided withstd::fmt::Formatterwhich implementsstd::fmt::Writetrait. (maybe I'm missing something trivial, so apologies in advance if that's the case)Current
format_intoimplementations though require&mut impl std::io::Writewhich is a different beast, more complex and aimed at different stuff, with vectored writes, flushing and all the rest. If one were to choose between the two, wouldn't it make sense to supportfmt::Writeand notio::Write? Is there a clean alternative way?(There's crates like
fmt2iothat provide hacky bridges but that's just ugly and wrong)