Skip to content

Commit

Permalink
perf: allocate exact capacity for RFC 9110 strings
Browse files Browse the repository at this point in the history
PR #198
  • Loading branch information
zacknewman authored Jan 12, 2025
1 parent 737076a commit c9c3ec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fmt/rfc2822.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ impl DateTimePrinter {
&self,
timestamp: &Timestamp,
) -> Result<alloc::string::String, Error> {
let mut buf = alloc::string::String::with_capacity(4);
let mut buf = alloc::string::String::with_capacity(29);
self.print_timestamp_rfc9110(timestamp, &mut buf)?;
Ok(buf)
}
Expand Down

0 comments on commit c9c3ec5

Please sign in to comment.