Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions xdk-build/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,13 @@ 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::<Vec<&str>>()
.into_iter()
.for_each(|line| {
let parts = line.split(" ").collect::<Vec<&str>>();
if parts.len() == 2 {
log_info!("{} {}", parts[0], parts[1].magenta());
}
});
// Bolt optimization: use char split and direct iteration/pattern matching to avoid Vec allocations
stdout.split('\n').for_each(|line| {
let mut parts = line.split(' ');
if let (Some(part1), Some(part2), None) = (parts.next(), parts.next(), parts.next()) {
log_info!("{} {}", part1, part2.magenta());
}
});
println!();
}

Expand Down
7 changes: 2 additions & 5 deletions xdk-lib/src/casing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ impl Casing {
result
}
}
Casing::Pascal => words
.iter()
.map(|w| pascal_case(w))
.collect::<Vec<_>>()
.join(""),
// Bolt optimization: collect directly to String instead of intermediate Vec + join
Casing::Pascal => words.iter().map(|w| pascal_case(w)).collect::<String>(),
Casing::Kebab => words.join("-").to_lowercase(),
Casing::ScreamingSnake => words.join("_").to_uppercase(),
}
Expand Down
Loading