diff --git a/Cargo.toml b/Cargo.toml index 97c076eb89..5e31225c6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -788,6 +788,9 @@ let_underscore_future = "allow" # running afoul of the borrow checker. too_many_arguments = "allow" +# We often have large enum variants yet we rarely actually bother with splitting them up. +large_enum_variant = "allow" + [workspace.metadata.cargo-machete] ignored = [ "bindgen", diff --git a/Dockerfile-collab b/Dockerfile-collab index 3c622d8fe1..48854af4da 100644 --- a/Dockerfile-collab +++ b/Dockerfile-collab @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:1.2 -FROM rust:1.86-bookworm as builder +FROM rust:1.87-bookworm as builder WORKDIR app COPY . . diff --git a/crates/agent/src/agent_configuration/configure_context_server_modal.rs b/crates/agent/src/agent_configuration/configure_context_server_modal.rs index 29c14d2662..c916e7dc32 100644 --- a/crates/agent/src/agent_configuration/configure_context_server_modal.rs +++ b/crates/agent/src/agent_configuration/configure_context_server_modal.rs @@ -30,7 +30,6 @@ pub(crate) struct ConfigureContextServerModal { context_server_store: Entity, } -#[allow(clippy::large_enum_variant)] enum Configuration { NotAvailable, Required(ConfigurationRequiredState), diff --git a/crates/assistant_tools/src/edit_agent/evals/fixtures/disable_cursor_blinking/before.rs b/crates/assistant_tools/src/edit_agent/evals/fixtures/disable_cursor_blinking/before.rs index afd47ed300..1204960463 100644 --- a/crates/assistant_tools/src/edit_agent/evals/fixtures/disable_cursor_blinking/before.rs +++ b/crates/assistant_tools/src/edit_agent/evals/fixtures/disable_cursor_blinking/before.rs @@ -1249,7 +1249,7 @@ pub struct ActiveDiagnosticGroup { } #[derive(Debug, PartialEq, Eq)] -#[allow(clippy::large_enum_variant)] + pub(crate) enum ActiveDiagnostic { None, All, diff --git a/crates/collab/src/db.rs b/crates/collab/src/db.rs index 04b6547692..9034f60892 100644 --- a/crates/collab/src/db.rs +++ b/crates/collab/src/db.rs @@ -543,7 +543,7 @@ pub struct MembershipUpdated { /// The result of setting a member's role. #[derive(Debug)] -#[allow(clippy::large_enum_variant)] + pub enum SetMemberRoleResult { InviteUpdated(Channel), MembershipUpdated(MembershipUpdated), diff --git a/crates/collab/src/main.rs b/crates/collab/src/main.rs index e5240666c4..f2dbf17587 100644 --- a/crates/collab/src/main.rs +++ b/crates/collab/src/main.rs @@ -36,6 +36,7 @@ use util::{ResultExt as _, maybe}; const VERSION: &str = env!("CARGO_PKG_VERSION"); const REVISION: Option<&'static str> = option_env!("GITHUB_SHA"); +#[expect(clippy::result_large_err)] #[tokio::main] async fn main() -> Result<()> { if let Err(error) = env::load_dotenv() { diff --git a/crates/collab/src/tests.rs b/crates/collab/src/tests.rs index 5a9af2a622..6ddb349700 100644 --- a/crates/collab/src/tests.rs +++ b/crates/collab/src/tests.rs @@ -36,8 +36,8 @@ fn room_participants(room: &Entity, cx: &mut TestAppContext) -> RoomPartic room.read_with(cx, |room, _| { let mut remote = room .remote_participants() - .iter() - .map(|(_, participant)| participant.user.github_login.clone()) + .values() + .map(|participant| participant.user.github_login.clone()) .collect::>(); let mut pending = room .pending_participants() diff --git a/crates/debugger_ui/src/session/running/stack_frame_list.rs b/crates/debugger_ui/src/session/running/stack_frame_list.rs index ba0f42e52a..efa2dbae63 100644 --- a/crates/debugger_ui/src/session/running/stack_frame_list.rs +++ b/crates/debugger_ui/src/session/running/stack_frame_list.rs @@ -39,7 +39,6 @@ pub struct StackFrameList { _refresh_task: Task<()>, } -#[allow(clippy::large_enum_variant)] #[derive(Debug, PartialEq, Eq)] pub enum StackFrameEntry { Normal(dap::StackFrame), diff --git a/crates/editor/src/code_context_menus.rs b/crates/editor/src/code_context_menus.rs index 858d055c87..74498c55b8 100644 --- a/crates/editor/src/code_context_menus.rs +++ b/crates/editor/src/code_context_menus.rs @@ -40,7 +40,6 @@ pub const MENU_ASIDE_X_PADDING: Pixels = px(16.); pub const MENU_ASIDE_MIN_WIDTH: Pixels = px(260.); pub const MENU_ASIDE_MAX_WIDTH: Pixels = px(500.); -#[allow(clippy::large_enum_variant)] pub enum CodeContextMenu { Completions(CompletionsMenu), CodeActions(CodeActionsMenu), @@ -928,7 +927,6 @@ impl CodeActionContents { } } -#[allow(clippy::large_enum_variant)] #[derive(Clone)] pub enum CodeActionsItem { Task(TaskSourceKind, ResolvedTask), diff --git a/crates/editor/src/display_map/block_map.rs b/crates/editor/src/display_map/block_map.rs index c6422ae741..8214ab7a8c 100644 --- a/crates/editor/src/display_map/block_map.rs +++ b/crates/editor/src/display_map/block_map.rs @@ -282,7 +282,6 @@ struct Transform { block: Option, } -#[allow(clippy::large_enum_variant)] #[derive(Clone)] pub enum Block { Custom(Arc), diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index ec182c1167..da7389f4aa 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -1311,7 +1311,7 @@ pub struct ActiveDiagnosticGroup { } #[derive(Debug, PartialEq, Eq)] -#[allow(clippy::large_enum_variant)] + pub(crate) enum ActiveDiagnostic { None, All, @@ -20278,8 +20278,8 @@ impl EditorSnapshot { let participant_indices = collaboration_hub.user_participant_indices(cx); let collaborators_by_peer_id = collaboration_hub.collaborators(cx); let collaborators_by_replica_id = collaborators_by_peer_id - .iter() - .map(|(_, collaborator)| (collaborator.replica_id, collaborator)) + .values() + .map(|collaborator| (collaborator.replica_id, collaborator)) .collect::>(); self.buffer_snapshot .selections_in_range(range, false) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 19c2ce311f..b601984ea7 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -6393,7 +6393,6 @@ pub(crate) struct LineWithInvisibles { font_size: Pixels, } -#[allow(clippy::large_enum_variant)] enum LineFragment { Text(ShapedLine), Element { diff --git a/crates/gpui/src/platform/linux/x11/clipboard.rs b/crates/gpui/src/platform/linux/x11/clipboard.rs index 7817ee9177..497794bb11 100644 --- a/crates/gpui/src/platform/linux/x11/clipboard.rs +++ b/crates/gpui/src/platform/linux/x11/clipboard.rs @@ -983,7 +983,7 @@ impl Clipboard { // format that the contents can be converted to format_atoms[0..IMAGE_FORMAT_COUNT].copy_from_slice(&image_format_atoms); format_atoms[IMAGE_FORMAT_COUNT..].copy_from_slice(&text_format_atoms); - debug_assert!(!format_atoms.iter().any(|&a| a == atom_none)); + debug_assert!(!format_atoms.contains(&atom_none)); let result = self.inner.read(&format_atoms, selection)?; diff --git a/crates/language/src/language.rs b/crates/language/src/language.rs index dd89f7e78a..1cb82be1ef 100644 --- a/crates/language/src/language.rs +++ b/crates/language/src/language.rs @@ -1858,9 +1858,9 @@ impl LanguageScope { pub fn language_allowed(&self, name: &LanguageServerName) -> bool { let config = &self.language.config; let opt_in_servers = &config.scope_opt_in_language_servers; - if opt_in_servers.iter().any(|o| *o == *name) { + if opt_in_servers.contains(name) { if let Some(over) = self.config_override() { - over.opt_into_language_servers.iter().any(|o| *o == *name) + over.opt_into_language_servers.contains(name) } else { false } diff --git a/crates/outline_panel/src/outline_panel.rs b/crates/outline_panel/src/outline_panel.rs index b577408f06..de3af65d58 100644 --- a/crates/outline_panel/src/outline_panel.rs +++ b/crates/outline_panel/src/outline_panel.rs @@ -1620,7 +1620,7 @@ impl OutlinePanel { .get(&external_file.buffer_id) .into_iter() .flat_map(|excerpts| { - excerpts.iter().map(|(excerpt_id, _)| { + excerpts.keys().map(|excerpt_id| { CollapsedEntry::Excerpt( external_file.buffer_id, *excerpt_id, @@ -1641,7 +1641,7 @@ impl OutlinePanel { entries.extend( self.excerpts.get(&file.buffer_id).into_iter().flat_map( |excerpts| { - excerpts.iter().map(|(excerpt_id, _)| { + excerpts.keys().map(|excerpt_id| { CollapsedEntry::Excerpt(file.buffer_id, *excerpt_id) }) }, diff --git a/crates/project/src/debugger/dap_store.rs b/crates/project/src/debugger/dap_store.rs index ff20de4d3c..848e13a293 100644 --- a/crates/project/src/debugger/dap_store.rs +++ b/crates/project/src/debugger/dap_store.rs @@ -64,7 +64,6 @@ pub enum DapStoreEvent { RemoteHasInitialized, } -#[allow(clippy::large_enum_variant)] enum DapStoreMode { Local(LocalDapStore), Ssh(SshDapStore), diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs index fa7169906f..c182b8490d 100644 --- a/crates/project/src/lsp_store.rs +++ b/crates/project/src/lsp_store.rs @@ -3415,7 +3415,6 @@ pub struct RemoteLspStore { upstream_project_id: u64, } -#[allow(clippy::large_enum_variant)] pub(crate) enum LspStoreMode { Local(LocalLspStore), // ssh host and collab host Remote(RemoteLspStore), // collab guest @@ -8806,9 +8805,10 @@ impl LspStore { }) }); - let is_unnecessary = diagnostic.tags.as_ref().map_or(false, |tags| { - tags.iter().any(|tag| *tag == DiagnosticTag::UNNECESSARY) - }); + let is_unnecessary = diagnostic + .tags + .as_ref() + .map_or(false, |tags| tags.contains(&DiagnosticTag::UNNECESSARY)); if is_supporting { supporting_diagnostics.insert( diff --git a/crates/project/src/manifest_tree/path_trie.rs b/crates/project/src/manifest_tree/path_trie.rs index 5dd14ecf8f..0f7575324b 100644 --- a/crates/project/src/manifest_tree/path_trie.rs +++ b/crates/project/src/manifest_tree/path_trie.rs @@ -98,7 +98,7 @@ impl RootPathTrie