Skip to main content

max / balanced_breakfast

Fix the last bb-pdf clippy warning format_push_string in the long_article_produces_multiple_pages test: build the fixture HTML with write! instead of push_str(&format!(..)), dropping the per-iteration allocation. bb-pdf is now clippy-clean, which matters because the Bento prebuild gate blocks releases on clippy.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-27 21:01 UTC
Signed with PGP, not checked
Commit: 800be18847760c5c93bde02365b8df4e396fe319
Parent: 248444c
1 file changed, +4 insertions, -2 deletions
@@ -441,11 +441,13 @@
441 441
442 442 #[test]
443 443 fn long_article_produces_multiple_pages() {
444 + use std::fmt::Write;
444 445 let mut html = String::from("<h1>Long</h1>");
445 446 for i in 0..200 {
446 - html.push_str(&format!(
447 + let _ = write!(
448 + html,
447 449 "<p>Paragraph number {i}. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>"
448 - ));
450 + );
449 451 }
450 452 let bytes = render_article(&html, "Long", None).unwrap();
451 453 assert!(bytes.starts_with(b"%PDF"));