Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
chore: Clippy fixes for 1.80 (#13987)
Piotr Osiewicz33a67ad6b926
diff --git a/Cargo.toml b/Cargo.tomlindex a3772d799d0..aa665f6897b 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -518,7 +518,7 @@ single_range_in_vec_init = "allow"# There are a bunch of rules currently failing in the `style` group, so# allow all of those, for now.-style = "allow"+style = { level = "allow", priority = -1 }# Individual rules that have violations in the codebase:almost_complete_range = "allow"diff --git a/crates/collab/src/db/tests/db_tests.rs b/crates/collab/src/db/tests/db_tests.rsindex 92baf29837d..4f9bb035fbf 100644--- a/crates/collab/src/db/tests/db_tests.rs+++ b/crates/collab/src/db/tests/db_tests.rs@@ -562,7 +562,7 @@ fn test_fuzzy_like_string() {assert_eq!(Database::fuzzy_like_string(" z "), "%z%");}-#[cfg(target = "macos")]+#[cfg(target_os = "macos")]#[gpui::test]async fn test_fuzzy_search_users(cx: &mut gpui::TestAppContext) {let test_db = tests::TestDb::postgres(cx.executor());diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex 73e97448f8b..4c5aab6ebea 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -11093,6 +11093,7 @@ impl Editor {if *singleton_buffer_edited {if let Some(project) = &self.project {let project = project.read(cx);+ #[allow(clippy::mutable_key_type)]let languages_affected = multibuffer.read(cx).all_buffers()diff --git a/crates/gpui/build.rs b/crates/gpui/build.rsindex 0808288e595..56fca5f7e85 100644--- a/crates/gpui/build.rs+++ b/crates/gpui/build.rs@@ -7,7 +7,7 @@ use std::env;fn main() {let target = env::var("CARGO_CFG_TARGET_OS");-+ println!("cargo::rustc-check-cfg=cfg(gles)");match target.as_deref() {Ok("macos") => {#[cfg(target_os = "macos")]diff --git a/crates/gpui/src/text_system.rs b/crates/gpui/src/text_system.rsindex 5a414c216cb..b884e2ef934 100644--- a/crates/gpui/src/text_system.rs+++ b/crates/gpui/src/text_system.rs@@ -658,26 +658,6 @@ impl Hash for RenderGlyphParams {}}-/// The parameters for rendering an emoji glyph.-#[derive(Clone, Debug, PartialEq)]-pub struct RenderEmojiParams {- pub(crate) font_id: FontId,- pub(crate) glyph_id: GlyphId,- pub(crate) font_size: Pixels,- pub(crate) scale_factor: f32,-}--impl Eq for RenderEmojiParams {}--impl Hash for RenderEmojiParams {- fn hash<H: Hasher>(&self, state: &mut H) {- self.font_id.0.hash(state);- self.glyph_id.0.hash(state);- self.font_size.0.to_bits().hash(state);- self.scale_factor.to_bits().hash(state);- }-}-/// The configuration details for identifying a specific font.#[derive(Clone, Debug, Eq, PartialEq, Hash)]pub struct Font {diff --git a/crates/language/src/syntax_map.rs b/crates/language/src/syntax_map.rsindex 92c9d52a7a7..cdc6d142594 100644--- a/crates/language/src/syntax_map.rs+++ b/crates/language/src/syntax_map.rs@@ -1207,7 +1207,7 @@ fn get_injections(language_registry: &Arc<LanguageRegistry>,depth: usize,changed_ranges: &[Range<usize>],- combined_injection_ranges: &mut HashMap<Arc<Language>, Vec<tree_sitter::Range>>,+ combined_injection_ranges: &mut HashMap<LanguageId, (Arc<Language>, Vec<tree_sitter::Range>)>,queue: &mut BinaryHeap<ParseStep>,) {let mut query_cursor = QueryCursorHandle::new();@@ -1223,7 +1223,7 @@ fn get_injections(.now_or_never().and_then(|language| language.ok()){- combined_injection_ranges.insert(language, Vec::new());+ combined_injection_ranges.insert(language.id, (language, Vec::new()));}}}@@ -1276,8 +1276,9 @@ fn get_injections(if let Some(language) = language {if combined {combined_injection_ranges- .entry(language.clone())- .or_default()+ .entry(language.id)+ .or_insert_with(|| (language.clone(), vec![]))+ .1.extend(content_ranges);} else {queue.push(ParseStep {@@ -1303,7 +1304,7 @@ fn get_injections(}}- for (language, mut included_ranges) in combined_injection_ranges.drain() {+ for (_, (language, mut included_ranges)) in combined_injection_ranges.drain() {included_ranges.sort_unstable_by(|a, b| {Ord::cmp(&a.start_byte, &b.start_byte).then_with(|| Ord::cmp(&a.end_byte, &b.end_byte))});diff --git a/crates/project/src/project.rs b/crates/project/src/project.rsindex 4d994542998..80edc906590 100644--- a/crates/project/src/project.rs+++ b/crates/project/src/project.rs@@ -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;diff --git a/crates/project/src/task_inventory.rs b/crates/project/src/task_inventory.rsindex ac3f93201ca..b5443617398 100644--- a/crates/project/src/task_inventory.rs+++ b/crates/project/src/task_inventory.rs@@ -444,11 +444,6 @@ mod test_inventory {use super::{task_source_kind_preference, TaskSourceKind, UnboundedSender};- #[derive(Debug, Clone, PartialEq, Eq)]- pub struct TestTask {- name: String,- }-pub(super) fn static_test_source(task_names: impl IntoIterator<Item = String>,updates: UnboundedSender<()>,