{
"id": "rust-format-collect",
"language": "rust",
"group": "performance",
"listingTitle": "Collect formatted Rust values without per-item allocation",
"title": "Collect formatted Rust values without per-item allocation",
"mvvm": false,
"defaultSeverity": "info",
"legacyGroup": "performance",
"why": "Mapping format! and collecting into String allocates a temporary String for every iterator element.",
"suggestion": "Create one String and append each formatted value with write! in fold or an explicit loop.",
"version": 1,
"semanticMaturity": "token",
"securityKind": "none",
"taxonomy": ["performance"],
"requirements": ["sourceText"],
"packs": ["rust"],
"implementation": "src/languages/rust/rules.rs",
"languages": ["rust"],
"frameworks": [],
"languageVersions": [],
"limitations": [
"Only iterator map calls containing format! and immediately followed by an explicit collect::<String>() are reported.",
"Equivalent inferred collect types, nested adapters, output size, and hot-path relevance are not inferred."
]
}