perf: eliminate unnecessary clones and improve API ergonomics
- PromptBuilder::new now takes &[String] instead of Vec<String> - GeminiClient::new now takes &str, &[String] instead of owned values - FileBatch::from_path now takes &Path instead of PathBuf - categorize_files_offline now takes Vec<String> (ownership) instead of &[String] - handle_offline_organization now takes FileBatch by value These changes eliminate ~5-50 KB of unnecessary allocations for typical file counts, reduce allocator pressure, and improve API clarity by properly expressing ownership semantics. No functional changes - all tests pass.
This commit is contained in:
@@ -23,7 +23,7 @@ pub struct PromptBuilder {
|
||||
}
|
||||
|
||||
impl PromptBuilder {
|
||||
pub fn new(file_list: Vec<String>) -> Self {
|
||||
pub fn new(file_list: &[String]) -> Self {
|
||||
Self {
|
||||
file_list: file_list.join(", "),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user