Skip to content

Conversation

@aatifsyed
Copy link

No description provided.

@aatifsyed aatifsyed force-pushed the aatifsyed/render-to branch from 9342df8 to 2d4bb53 Compare December 8, 2025 13:09
@epage
Copy link
Contributor

epage commented Dec 8, 2025

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 CONTRIBUTING.md. @Muscraft I leave it to you whether you want my standard boileplate, write your own guide, or to leave it.

@aatifsyed
Copy link
Author

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 :)

@epage
Copy link
Contributor

epage commented Dec 8, 2025

I'm building reporting for my application, and don't want to allocate intermediate strings :)

So this is for performance? Did profiling show that this was a hotspot?

@aatifsyed
Copy link
Author

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)
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants