Fix clippy::needless_borrow lint violations (#36444)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-18 23:54:35 +02:00 committed by GitHub
parent eecf142f06
commit 9e0e233319
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
242 changed files with 801 additions and 821 deletions

View file

@ -716,7 +716,7 @@ impl EditPreview {
&self.applied_edits_snapshot,
&self.syntax_snapshot,
None,
&syntax_theme,
syntax_theme,
);
}
@ -727,7 +727,7 @@ impl EditPreview {
&current_snapshot.text,
&current_snapshot.syntax,
Some(deletion_highlight_style),
&syntax_theme,
syntax_theme,
);
}
@ -737,7 +737,7 @@ impl EditPreview {
&self.applied_edits_snapshot,
&self.syntax_snapshot,
Some(insertion_highlight_style),
&syntax_theme,
syntax_theme,
);
}
@ -749,7 +749,7 @@ impl EditPreview {
&self.applied_edits_snapshot,
&self.syntax_snapshot,
None,
&syntax_theme,
syntax_theme,
);
highlighted_text.build()

View file

@ -1830,7 +1830,7 @@ impl Language {
impl LanguageScope {
pub fn path_suffixes(&self) -> &[String] {
&self.language.path_suffixes()
self.language.path_suffixes()
}
pub fn language_name(&self) -> LanguageName {

View file

@ -1102,7 +1102,7 @@ impl LanguageRegistry {
use gpui::AppContext as _;
let mut state = self.state.write();
let fake_entry = state.fake_server_entries.get_mut(&name)?;
let fake_entry = state.fake_server_entries.get_mut(name)?;
let (server, mut fake_server) = lsp::FakeLanguageServer::new(
server_id,
binary,

View file

@ -187,8 +187,8 @@ impl LanguageSettings {
let rest = available_language_servers
.iter()
.filter(|&available_language_server| {
!disabled_language_servers.contains(&available_language_server)
&& !enabled_language_servers.contains(&available_language_server)
!disabled_language_servers.contains(available_language_server)
&& !enabled_language_servers.contains(available_language_server)
})
.cloned()
.collect::<Vec<_>>();

View file

@ -1297,7 +1297,7 @@ fn parse_text(
) -> anyhow::Result<Tree> {
with_parser(|parser| {
let mut chunks = text.chunks_in_range(start_byte..text.len());
parser.set_included_ranges(&ranges)?;
parser.set_included_ranges(ranges)?;
parser.set_language(&grammar.ts_language)?;
parser
.parse_with_options(

View file

@ -154,19 +154,19 @@ fn diff_internal(
input,
|old_tokens: Range<u32>, new_tokens: Range<u32>| {
old_offset += token_len(
&input,
input,
&input.before[old_token_ix as usize..old_tokens.start as usize],
);
new_offset += token_len(
&input,
input,
&input.after[new_token_ix as usize..new_tokens.start as usize],
);
let old_len = token_len(
&input,
input,
&input.before[old_tokens.start as usize..old_tokens.end as usize],
);
let new_len = token_len(
&input,
input,
&input.after[new_tokens.start as usize..new_tokens.end as usize],
);
let old_byte_range = old_offset..old_offset + old_len;