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

allocate exact capacity for RFC 9110 strings #198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zacknewman
Copy link

fmt::rfc2822::DateTimePrinter::timestamp_to_rfc9110_string allocates a String with capacity of 4; however RFC 9110-preferred-format strings are guaranteed to have an exact length of 29. I realize this crate doesn't prioritize performance; however the fact that String::with_capacity was already used as opposed to String::new suggests this isn't an entirely inappropriate diff.

@zacknewman
Copy link
Author

The CI failure is obviously not related to this PR.

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.

1 participant