feat: Renderer::render_to(impl Write, ..)#355
Conversation
9342df8 to
2d4bb53
Compare
|
What is the motivation for this new API? btw we've found it best if these things are discussed in issues first to ensure alignment (and other benefits) before moving on to implementation. Looks like we don't call that out in a |
|
I'm building reporting for my application, and don't want to allocate intermediate strings :) I understand that there's StyledBuffer already, but that's a deeper refactor that I'm not interested in writing at this time :) |
So this is for performance? Did profiling show that this was a hotspot? |
No and no, the following just felt wrong :) : impl fmt::Display for MyError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// ...
let s = my_renderer.render(my_report);
f.write_str(&s)
}
} |
No description provided.