Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filters: Don't use .to_string() #75

Merged
merged 1 commit into from
Jul 13, 2024

Conversation

Kijewski
Copy link
Collaborator

Rinja's render() is fallible, so a user might not expect that an input to e.g. |upper can cause a panic if its formatting failed.

This PR replaces impl ToString parameters with impl fmt::Display, and the string building uses a fallible write!() call.

Rinja's `render()` is fallible, so a user might not expect that an input
to e.g. `|upper` can cause a panic if its formatting failed.

This PR replaces `impl ToString` parameters with `impl fmt::Display`,
and the string building uses a fallible `write!()` call.
@GuillaumeGomez
Copy link
Contributor

Very good point, thanks!

@GuillaumeGomez GuillaumeGomez merged commit 94b040d into rinja-rs:master Jul 13, 2024
17 checks passed
@Kijewski Kijewski deleted the pr-no-to-string branch July 13, 2024 08:36
@Kijewski Kijewski restored the pr-no-to-string branch July 13, 2024 08:36
@Kijewski Kijewski deleted the pr-no-to-string branch July 13, 2024 08:36
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