diff --git a/crates/agent_ui/src/threads_archive_view.rs b/crates/agent_ui/src/threads_archive_view.rs index f8583ba5b6..a86c902443 100644 --- a/crates/agent_ui/src/threads_archive_view.rs +++ b/crates/agent_ui/src/threads_archive_view.rs @@ -1340,7 +1340,7 @@ impl PickerDelegate for ProjectPickerDelegate { .ordered_paths() .map(|path| path.compact().to_string_lossy().into_owned()) .collect::>() - .join(""); + .concat(); StringMatchCandidate::new(id, &combined_string) }) .collect(); @@ -1376,7 +1376,7 @@ impl PickerDelegate for ProjectPickerDelegate { .ordered_paths() .map(|path| path.compact().to_string_lossy().into_owned()) .collect::>() - .join(""); + .concat(); StringMatchCandidate::new(id, &combined_string) }) .collect(); diff --git a/crates/edit_prediction_cli/src/predict.rs b/crates/edit_prediction_cli/src/predict.rs index c925527feb..a78d4d12d7 100644 --- a/crates/edit_prediction_cli/src/predict.rs +++ b/crates/edit_prediction_cli/src/predict.rs @@ -529,7 +529,7 @@ async fn predict_openai( _ => None, }) .collect::>() - .join(""), + .concat(), }), _ => None, }) diff --git a/crates/edit_prediction_cli/src/qa.rs b/crates/edit_prediction_cli/src/qa.rs index a2c5ad30b9..81a2a77b27 100644 --- a/crates/edit_prediction_cli/src/qa.rs +++ b/crates/edit_prediction_cli/src/qa.rs @@ -221,7 +221,7 @@ pub async fn run_qa( _ => None, }) .collect::>() - .join("") + .concat() } BatchProvider::Openai => { let client = if args.no_batch { @@ -255,13 +255,13 @@ pub async fn run_qa( _ => None, }) .collect::>() - .join(""), + .concat(), }) } _ => None, }) .collect::>() - .join("") + .concat() } }; diff --git a/crates/edit_prediction_cli/src/reorder_patch.rs b/crates/edit_prediction_cli/src/reorder_patch.rs index 74018cae40..aed393a15b 100644 --- a/crates/edit_prediction_cli/src/reorder_patch.rs +++ b/crates/edit_prediction_cli/src/reorder_patch.rs @@ -338,7 +338,7 @@ impl ToString for Hunk { .iter() .map(|line| line.to_string() + "\n") .collect::>() - .join(""); + .concat(); format!("{header}\n{lines}") } } diff --git a/crates/edit_prediction_cli/src/repair.rs b/crates/edit_prediction_cli/src/repair.rs index 751e55a8b1..a6f82bc645 100644 --- a/crates/edit_prediction_cli/src/repair.rs +++ b/crates/edit_prediction_cli/src/repair.rs @@ -367,7 +367,7 @@ pub async fn run_repair( _ => None, }) .collect::>() - .join("") + .concat() } BatchProvider::Openai => { let client = if args.no_batch { @@ -414,13 +414,13 @@ pub async fn run_repair( _ => None, }) .collect::>() - .join(""), + .concat(), }) } _ => None, }) .collect::>() - .join("") + .concat() } }; diff --git a/crates/editor/src/inlays/inlay_hints.rs b/crates/editor/src/inlays/inlay_hints.rs index ac3133ea89..0efc4355a6 100644 --- a/crates/editor/src/inlays/inlay_hints.rs +++ b/crates/editor/src/inlays/inlay_hints.rs @@ -2324,8 +2324,8 @@ pub mod tests { fs.insert_tree( path!("/a"), json!({ - "main.rs": format!("fn main() {{\n{}\n}}", (0..501).map(|i| format!("let i = {i};\n")).collect::>().join("")), - "other.rs": format!("fn main() {{\n{}\n}}", (0..501).map(|j| format!("let j = {j};\n")).collect::>().join("")), + "main.rs": format!("fn main() {{\n{}\n}}", (0..501).map(|i| format!("let i = {i};\n")).collect::()), + "other.rs": format!("fn main() {{\n{}\n}}", (0..501).map(|j| format!("let j = {j};\n")).collect::()), }), ) .await; @@ -2693,7 +2693,7 @@ pub mod tests { fs.insert_tree( path!("/a"), json!({ - "main.rs": format!("fn main() {{\n{}\n}}", (0..200).map(|i| format!("let i = {i};\n")).collect::>().join("")), + "main.rs": format!("fn main() {{\n{}\n}}", (0..200).map(|i| format!("let i = {i};\n")).collect::()), "lib.rs": r#"let a = 1; let b = 2; let c = 3;"# @@ -2940,8 +2940,8 @@ let c = 3;"# fs.insert_tree( path!("/a"), json!({ - "main.rs": format!("fn main() {{\n{}\n}}", (0..501).map(|i| format!("let i = {i};\n")).collect::>().join("")), - "other.rs": format!("fn main() {{\n{}\n}}", (0..501).map(|j| format!("let j = {j};\n")).collect::>().join("")), + "main.rs": format!("fn main() {{\n{}\n}}", (0..501).map(|i| format!("let i = {i};\n")).collect::()), + "other.rs": format!("fn main() {{\n{}\n}}", (0..501).map(|j| format!("let j = {j};\n")).collect::()), }), ) .await; diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 9d5ad821ed..884f5a8325 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -1786,7 +1786,7 @@ impl SearchableItem for Editor { let text: Cow<_> = if text.len() == 1 { text.first().cloned().unwrap().into() } else { - let joined_chunks = text.join(""); + let joined_chunks = text.concat(); joined_chunks.into() }; @@ -1818,7 +1818,7 @@ impl SearchableItem for Editor { let text: Cow<_> = if text.len() == 1 { text.first().cloned().unwrap().into() } else { - let joined_chunks = text.join(""); + let joined_chunks = text.concat(); joined_chunks.into() }; diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index b8d0677fa2..9a239c2a81 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -2582,7 +2582,7 @@ impl GitPanel { } }) .collect::>() - .join(""); + .concat(); if compressed.len() <= max_bytes { return compressed; diff --git a/crates/gpui_macos/src/keyboard.rs b/crates/gpui_macos/src/keyboard.rs index 63e56a260a..2b5b644a3a 100644 --- a/crates/gpui_macos/src/keyboard.rs +++ b/crates/gpui_macos/src/keyboard.rs @@ -106,7 +106,7 @@ impl MacKeyboardMapper { // // These mappings were generated by running https://github.com/ConradIrwin/keyboard-inspector, tidying up the // output to remove languages with no mappings and other oddities, and converting it to a less verbose representation with: -// jq -s 'map(to_entries | map({key: .key, value: [(.value | to_entries | map(.key) | join("")), (.value | to_entries | map(.value) | join(""))]}) | from_entries) | add' +// jq -s 'map(to_entries | map({key: .key, value: [(.value | to_entries | map(.key) | concat()), (.value | to_entries | map(.value) | concat())]}) | from_entries) | add' // From there I used multi-cursor to produce this match statement. fn get_key_equivalents(layout_id: &str) -> Option> { let mappings: &[(char, char)] = match layout_id { diff --git a/crates/open_router/src/open_router.rs b/crates/open_router/src/open_router.rs index 306f2c22cb..83f744e101 100644 --- a/crates/open_router/src/open_router.rs +++ b/crates/open_router/src/open_router.rs @@ -305,7 +305,7 @@ impl MessageContent { } }) .collect::>() - .join(""), + .concat(), } } } diff --git a/crates/recent_projects/src/recent_projects.rs b/crates/recent_projects/src/recent_projects.rs index 80733c3225..3ad59a14db 100644 --- a/crates/recent_projects/src/recent_projects.rs +++ b/crates/recent_projects/src/recent_projects.rs @@ -981,7 +981,7 @@ impl PickerDelegate for RecentProjectsDelegate { .ordered_paths() .map(|path| path.compact().to_string_lossy().into_owned()) .collect::>() - .join(""); + .concat(); StringMatchCandidate::new(id, &combined_string) }) .collect(); @@ -1006,7 +1006,7 @@ impl PickerDelegate for RecentProjectsDelegate { .ordered_paths() .map(|path| path.compact().to_string_lossy().into_owned()) .collect::>() - .join(""); + .concat(); StringMatchCandidate::new(id, &combined_string) }) .collect(); diff --git a/crates/recent_projects/src/sidebar_recent_projects.rs b/crates/recent_projects/src/sidebar_recent_projects.rs index c5d1203bf2..5e44e1a90c 100644 --- a/crates/recent_projects/src/sidebar_recent_projects.rs +++ b/crates/recent_projects/src/sidebar_recent_projects.rs @@ -203,7 +203,7 @@ impl PickerDelegate for SidebarRecentProjectsDelegate { .ordered_paths() .map(|path| path.compact().to_string_lossy().into_owned()) .collect::>() - .join(""); + .concat(); StringMatchCandidate::new(id, &combined_string) }) .collect(); diff --git a/crates/repl/src/notebook/cell.rs b/crates/repl/src/notebook/cell.rs index cf602a46de..2267c135c1 100644 --- a/crates/repl/src/notebook/cell.rs +++ b/crates/repl/src/notebook/cell.rs @@ -176,7 +176,7 @@ impl Cell { source, .. } => { - let source = source.join(""); + let source = source.concat(); let entity = cx.new(|cx| { MarkdownCell::new( @@ -198,7 +198,7 @@ impl Cell { source, outputs, } => { - let text = source.join(""); + let text = source.concat(); let outputs = convert_outputs(outputs, window, cx); Cell::Code(cx.new(|cx| { @@ -223,7 +223,7 @@ impl Cell { } => Cell::Raw(cx.new(|_| RawCell { id: id.clone(), metadata: metadata.clone(), - source: source.join(""), + source: source.concat(), selected: false, cell_position: None, })), diff --git a/crates/tasks_ui/src/modal.rs b/crates/tasks_ui/src/modal.rs index f5a416ad3c..22ad76ca6e 100644 --- a/crates/tasks_ui/src/modal.rs +++ b/crates/tasks_ui/src/modal.rs @@ -464,7 +464,7 @@ impl PickerDelegate for TasksModalDelegate { .iter() .map(|tag| format!("\n#{}", tag)) .collect::>() - .join("") + .concat() .as_str(), ); } diff --git a/crates/terminal_view/src/terminal_view.rs b/crates/terminal_view/src/terminal_view.rs index 63943a2022..61646d72d7 100644 --- a/crates/terminal_view/src/terminal_view.rs +++ b/crates/terminal_view/src/terminal_view.rs @@ -14,7 +14,6 @@ use gpui::{ Pixels, Point as GpuiPoint, Render, ScrollWheelEvent, Styled, Subscription, Task, TaskExt, WeakEntity, actions, anchored, deferred, div, }; -use itertools::Itertools; use menu; use persistence::TerminalDb; use project::{Project, ProjectEntryId, search::SearchQuery}; @@ -927,7 +926,10 @@ impl TerminalView { } pub fn add_paths_to_terminal(&self, paths: &[PathBuf], window: &mut Window, cx: &mut App) { - let mut text = paths.iter().map(|path| format!(" {path:?}")).join(""); + let mut text = paths + .iter() + .map(|path| format!(" {path:?}")) + .collect::(); text.push(' '); window.focus(&self.focus_handle(cx), cx); self.terminal.update(cx, |terminal, _| { diff --git a/crates/vim/src/mode_indicator.rs b/crates/vim/src/mode_indicator.rs index daab005183..39195a7467 100644 --- a/crates/vim/src/mode_indicator.rs +++ b/crates/vim/src/mode_indicator.rs @@ -83,7 +83,7 @@ impl ModeIndicator { .map(|count| format!("{}", count)), ) .collect::>() - .join("") + .concat() } }