chore: Clippy fixes for 1.80 (#13987)

The biggest hurdle turned out to be use of `Arc<Language>` in maps, as
`clippy::mutable_key_type` started triggering on it (due to - I suppose
- internal mutability on `HighlightMap`?). I switched over to using
`LanguageId` as the key type in some of the callsites, as that's what
`Language` uses anyways for it's hash/eq, though I've still had to
suppress the lint outside of language crate.

/cc @maxdeviant , le clippy guru.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-07-10 17:53:17 +02:00 committed by GitHub
parent d4ddc4c62c
commit 33a67ad6b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 12 additions and 33 deletions

View file

@ -4106,6 +4106,7 @@ impl Project {
return;
}
#[allow(clippy::mutable_key_type)]
let language_server_lookup_info: HashSet<(Model<Worktree>, Arc<Language>)> = buffers
.into_iter()
.filter_map(|buffer| {
@ -11066,6 +11067,7 @@ async fn populate_labels_for_symbols(
lsp_adapter: Option<Arc<CachedLspAdapter>>,
output: &mut Vec<Symbol>,
) {
#[allow(clippy::mutable_key_type)]
let mut symbols_by_language = HashMap::<Option<Arc<Language>>, Vec<CoreSymbol>>::default();
let mut unknown_path = None;