diff --git a/xdk-build/src/python.rs b/xdk-build/src/python.rs index 1d15d6f0..3323aa33 100644 --- a/xdk-build/src/python.rs +++ b/xdk-build/src/python.rs @@ -159,16 +159,14 @@ fn run_formatter(output_dir: &Path, venv_python_path: &Path, script_path: &Path) let stdout = String::from_utf8_lossy(&output.stdout); if !stdout.trim().is_empty() { println!(); - stdout - .split("\n") - .collect::>() - .into_iter() - .for_each(|line| { - let parts = line.split(" ").collect::>(); - if parts.len() == 2 { - log_info!("{} {}", parts[0], parts[1].magenta()); - } - }); + // Bolt ⚡: Removed `.collect::>()` allocations and switched to char splits + // for zero-allocation iteration over lines and words. + stdout.split('\n').for_each(|line| { + let mut parts = line.split(' '); + if let (Some(part0), Some(part1), None) = (parts.next(), parts.next(), parts.next()) { + log_info!("{} {}", part0, part1.magenta()); + } + }); println!(); }