Fix clippy::needless_borrow lint violations (#36444)
Release Notes: - N/A
This commit is contained in:
parent
eecf142f06
commit
9e0e233319
242 changed files with 801 additions and 821 deletions
|
@ -103,7 +103,7 @@ fn prompt<T>(
|
|||
where
|
||||
T: IntoEnumIterator + VariantNames + 'static,
|
||||
{
|
||||
let rx = window.prompt(PromptLevel::Info, msg, detail, &T::VARIANTS, cx);
|
||||
let rx = window.prompt(PromptLevel::Info, msg, detail, T::VARIANTS, cx);
|
||||
cx.spawn(async move |_| Ok(T::iter().nth(rx.await?).unwrap()))
|
||||
}
|
||||
|
||||
|
@ -652,14 +652,14 @@ impl GitPanel {
|
|||
if GitPanelSettings::get_global(cx).sort_by_path {
|
||||
return self
|
||||
.entries
|
||||
.binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(&path))
|
||||
.binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(path))
|
||||
.ok();
|
||||
}
|
||||
|
||||
if self.conflicted_count > 0 {
|
||||
let conflicted_start = 1;
|
||||
if let Ok(ix) = self.entries[conflicted_start..conflicted_start + self.conflicted_count]
|
||||
.binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(&path))
|
||||
.binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(path))
|
||||
{
|
||||
return Some(conflicted_start + ix);
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ impl GitPanel {
|
|||
0
|
||||
} + 1;
|
||||
if let Ok(ix) = self.entries[tracked_start..tracked_start + self.tracked_count]
|
||||
.binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(&path))
|
||||
.binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(path))
|
||||
{
|
||||
return Some(tracked_start + ix);
|
||||
}
|
||||
|
@ -687,7 +687,7 @@ impl GitPanel {
|
|||
0
|
||||
} + 1;
|
||||
if let Ok(ix) = self.entries[untracked_start..untracked_start + self.new_count]
|
||||
.binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(&path))
|
||||
.binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(path))
|
||||
{
|
||||
return Some(untracked_start + ix);
|
||||
}
|
||||
|
@ -1341,7 +1341,7 @@ impl GitPanel {
|
|||
.iter()
|
||||
.filter_map(|entry| entry.status_entry())
|
||||
.filter(|status_entry| {
|
||||
section.contains(&status_entry, repository)
|
||||
section.contains(status_entry, repository)
|
||||
&& status_entry.staging.as_bool() != Some(goal_staged_state)
|
||||
})
|
||||
.map(|status_entry| status_entry.clone())
|
||||
|
@ -1952,7 +1952,7 @@ impl GitPanel {
|
|||
thinking_allowed: false,
|
||||
};
|
||||
|
||||
let stream = model.stream_completion_text(request, &cx);
|
||||
let stream = model.stream_completion_text(request, cx);
|
||||
match stream.await {
|
||||
Ok(mut messages) => {
|
||||
if !text_empty {
|
||||
|
@ -4620,7 +4620,7 @@ impl editor::Addon for GitPanelAddon {
|
|||
|
||||
git_panel
|
||||
.read(cx)
|
||||
.render_buffer_header_controls(&git_panel, &file, window, cx)
|
||||
.render_buffer_header_controls(&git_panel, file, window, cx)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue