From d19957b705ac2ef24af6258f602b50bada76d144 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Sat, 2 Mar 2024 21:57:40 -0500 Subject: [PATCH] Enable `clippy::redundant_locals` (#8750) This PR enables the [`clippy::redundant_locals`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_locals) rule and fixes the outstanding violations. Release Notes: - N/A --- crates/editor/src/editor.rs | 1 - crates/rpc/src/conn.rs | 1 - crates/semantic_index/src/semantic_index.rs | 1 - crates/terminal_view/src/terminal_element.rs | 1 - crates/workspace/src/workspace.rs | 1 - tooling/xtask/src/main.rs | 1 - 6 files changed, 6 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index ed2c90f953..1e052aac72 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -8810,7 +8810,6 @@ impl Editor { Ok(i) | Err(i) => i, }; - let right_position = right_position; ranges[start_ix..] .iter() .take_while(move |range| range.start.cmp(&right_position, buffer).is_le()) diff --git a/crates/rpc/src/conn.rs b/crates/rpc/src/conn.rs index ae5c9fd226..18bce4abba 100644 --- a/crates/rpc/src/conn.rs +++ b/crates/rpc/src/conn.rs @@ -84,7 +84,6 @@ impl Connection { }); let rx = rx.then({ - let killed = killed; let executor = executor.clone(); move |msg| { let killed = killed.clone(); diff --git a/crates/semantic_index/src/semantic_index.rs b/crates/semantic_index/src/semantic_index.rs index 6f3bf9b3ac..f4b1b67aaa 100644 --- a/crates/semantic_index/src/semantic_index.rs +++ b/crates/semantic_index/src/semantic_index.rs @@ -840,7 +840,6 @@ impl SemanticIndex { let mut batch_results = Vec::new(); for batch in file_ids.chunks(batch_size) { let batch = batch.into_iter().map(|v| *v).collect::>(); - let limit = limit; let fs = fs.clone(); let db_path = db_path.clone(); let query = query.clone(); diff --git a/crates/terminal_view/src/terminal_element.rs b/crates/terminal_view/src/terminal_element.rs index 7141f7cb45..c70cd87df1 100644 --- a/crates/terminal_view/src/terminal_element.rs +++ b/crates/terminal_view/src/terminal_element.rs @@ -645,7 +645,6 @@ impl TerminalElement { }); cx.on_mouse_event({ - let bounds = bounds; let focus = self.focus.clone(); let terminal = self.terminal.clone(); move |e: &MouseMoveEvent, phase, cx| { diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 5452240e3c..e7f0fb7792 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -871,7 +871,6 @@ impl Workspace { cx.open_window(options, { let app_state = app_state.clone(); - let workspace_id = workspace_id; let project_handle = project_handle.clone(); move |cx| { cx.new_view(|cx| { diff --git a/tooling/xtask/src/main.rs b/tooling/xtask/src/main.rs index 2089bd3cd4..6b8000532d 100644 --- a/tooling/xtask/src/main.rs +++ b/tooling/xtask/src/main.rs @@ -111,7 +111,6 @@ fn run_clippy(args: ClippyArgs) -> Result<()> { "clippy::option_map_unit_fn", "clippy::redundant_closure_call", "clippy::redundant_guards", - "clippy::redundant_locals", "clippy::reversed_empty_ranges", "clippy::single_range_in_vec_init", "clippy::suspicious_to_owned",