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
This commit is contained in:
Marshall Bowers 2024-03-02 21:57:40 -05:00 committed by GitHub
parent 328c8a94b3
commit d19957b705
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 0 additions and 6 deletions

View File

@ -8810,7 +8810,6 @@ impl Editor {
Ok(i) | Err(i) => i, Ok(i) | Err(i) => i,
}; };
let right_position = right_position;
ranges[start_ix..] ranges[start_ix..]
.iter() .iter()
.take_while(move |range| range.start.cmp(&right_position, buffer).is_le()) .take_while(move |range| range.start.cmp(&right_position, buffer).is_le())

View File

@ -84,7 +84,6 @@ impl Connection {
}); });
let rx = rx.then({ let rx = rx.then({
let killed = killed;
let executor = executor.clone(); let executor = executor.clone();
move |msg| { move |msg| {
let killed = killed.clone(); let killed = killed.clone();

View File

@ -840,7 +840,6 @@ impl SemanticIndex {
let mut batch_results = Vec::new(); let mut batch_results = Vec::new();
for batch in file_ids.chunks(batch_size) { for batch in file_ids.chunks(batch_size) {
let batch = batch.into_iter().map(|v| *v).collect::<Vec<i64>>(); let batch = batch.into_iter().map(|v| *v).collect::<Vec<i64>>();
let limit = limit;
let fs = fs.clone(); let fs = fs.clone();
let db_path = db_path.clone(); let db_path = db_path.clone();
let query = query.clone(); let query = query.clone();

View File

@ -645,7 +645,6 @@ impl TerminalElement {
}); });
cx.on_mouse_event({ cx.on_mouse_event({
let bounds = bounds;
let focus = self.focus.clone(); let focus = self.focus.clone();
let terminal = self.terminal.clone(); let terminal = self.terminal.clone();
move |e: &MouseMoveEvent, phase, cx| { move |e: &MouseMoveEvent, phase, cx| {

View File

@ -871,7 +871,6 @@ impl Workspace {
cx.open_window(options, { cx.open_window(options, {
let app_state = app_state.clone(); let app_state = app_state.clone();
let workspace_id = workspace_id;
let project_handle = project_handle.clone(); let project_handle = project_handle.clone();
move |cx| { move |cx| {
cx.new_view(|cx| { cx.new_view(|cx| {

View File

@ -111,7 +111,6 @@ fn run_clippy(args: ClippyArgs) -> Result<()> {
"clippy::option_map_unit_fn", "clippy::option_map_unit_fn",
"clippy::redundant_closure_call", "clippy::redundant_closure_call",
"clippy::redundant_guards", "clippy::redundant_guards",
"clippy::redundant_locals",
"clippy::reversed_empty_ranges", "clippy::reversed_empty_ranges",
"clippy::single_range_in_vec_init", "clippy::single_range_in_vec_init",
"clippy::suspicious_to_owned", "clippy::suspicious_to_owned",