diff --git a/Dockerfile-collab b/Dockerfile-collab index 188e7daddfb471c41b237ca75469355cfc866ae3..63359334906b58c560c0ed6acc6378259ccbd5c5 100644 --- a/Dockerfile-collab +++ b/Dockerfile-collab @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:1.2 -FROM rust:1.92-bookworm as builder +FROM rust:1.93-bookworm as builder WORKDIR app COPY . . diff --git a/crates/gpui/src/elements/list.rs b/crates/gpui/src/elements/list.rs index 7c292b40a15bbb51b32af832024ecb26cd433b2d..26cf14a8d39f763d82a5f4070f372e845ace8815 100644 --- a/crates/gpui/src/elements/list.rs +++ b/crates/gpui/src/elements/list.rs @@ -526,8 +526,12 @@ impl ListState { } impl StateInner { - fn visible_range(&self, height: Pixels, scroll_top: &ListOffset) -> Range { - let mut cursor = self.items.cursor::(()); + fn visible_range( + items: &SumTree, + height: Pixels, + scroll_top: &ListOffset, + ) -> Range { + let mut cursor = items.cursor::(()); cursor.seek(&Count(scroll_top.item_ix), Bias::Right); let start_y = cursor.start().height + scroll_top.offset_in_item; cursor.seek_forward(&Height(start_y + height), Bias::Left); @@ -570,9 +574,9 @@ impl StateInner { }); } - if self.scroll_handler.is_some() { - let visible_range = self.visible_range(height, scroll_top); - self.scroll_handler.as_mut().unwrap()( + if let Some(handler) = self.scroll_handler.as_mut() { + let visible_range = Self::visible_range(&self.items, height, scroll_top); + handler( &ListScrollEvent { visible_range, count: self.items.summary().count, diff --git a/crates/gpui/src/key_dispatch.rs b/crates/gpui/src/key_dispatch.rs index 2f0848660eca6e8b17e5e1402f8334566a82856e..73d77f71d242e8fd40c71ecf30772e1ea7fa2b62 100644 --- a/crates/gpui/src/key_dispatch.rs +++ b/crates/gpui/src/key_dispatch.rs @@ -199,8 +199,8 @@ impl DispatchTree { if let Some(context) = node.context.clone() { self.context_stack.push(context); } - if node.view_id.is_some() { - self.view_stack.push(node.view_id.unwrap()); + if let Some(view_id) = node.view_id { + self.view_stack.push(view_id); } self.node_stack.push(node_id); current_node_id = node.parent; diff --git a/crates/remote/src/transport/docker.rs b/crates/remote/src/transport/docker.rs index d2c7dc74bff20abf875a413c3ad4e81b955ab119..713e532704063a244b94a7f2fb0fbd5a47727f23 100644 --- a/crates/remote/src/transport/docker.rs +++ b/crates/remote/src/transport/docker.rs @@ -143,11 +143,9 @@ impl DockerExecConnection { commit: Option, cx: &mut AsyncApp, ) -> Result> { - let remote_platform = if self.remote_platform.is_some() { - self.remote_platform.unwrap() - } else { - anyhow::bail!("No remote platform defined; cannot proceed.") - }; + let remote_platform = self + .remote_platform + .context("No remote platform defined; cannot proceed.")?; let version_str = match release_channel { ReleaseChannel::Nightly => { diff --git a/crates/settings_ui/src/components/section_items.rs b/crates/settings_ui/src/components/section_items.rs index 69559d24f447f3d218b296600ed1ecdd9bf1dc30..9c98a80737f82f455ac2a0a1c2d97b13402bb20d 100644 --- a/crates/settings_ui/src/components/section_items.rs +++ b/crates/settings_ui/src/components/section_items.rs @@ -40,11 +40,11 @@ impl RenderOnce for SettingsSectionHeader { .when(!self.no_padding, |this| this.px_8()) .gap_1p5() .map(|this| { - if self.icon.is_some() { + if let Some(icon) = self.icon { this.child( h_flex() .gap_1p5() - .child(Icon::new(self.icon.unwrap()).color(Color::Muted)) + .child(Icon::new(icon).color(Color::Muted)) .child(label), ) } else { diff --git a/crates/ui/src/components/modal.rs b/crates/ui/src/components/modal.rs index 85565f54885a06ddf2bc84f3639ca00fc4acc50e..6d273dde4fcaaafc455d01d555f81ee3c600345d 100644 --- a/crates/ui/src/components/modal.rs +++ b/crates/ui/src/components/modal.rs @@ -159,10 +159,10 @@ impl RenderOnce for ModalHeader { fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement { let mut children = self.children; - if self.headline.is_some() { + if let Some(headline) = self.headline { children.insert( 0, - Headline::new(self.headline.unwrap()) + Headline::new(headline) .size(HeadlineSize::XSmall) .color(Color::Muted) .into_any_element(), diff --git a/crates/vim/src/command.rs b/crates/vim/src/command.rs index 5f53ebaec68a6a1869c9830a493a859ad0aae9de..e320790a9b9cef8ea8ffd2ba9d8676dbfd6b87b5 100644 --- a/crates/vim/src/command.rs +++ b/crates/vim/src/command.rs @@ -1166,8 +1166,8 @@ impl VimCommand { has_bang, has_space: _, } = self.get_parsed_query(query.to_string())?; - let action = if has_bang && self.bang_action.is_some() { - self.bang_action.as_ref().unwrap().boxed_clone() + let action = if has_bang && let Some(bang_action) = self.bang_action.as_ref() { + bang_action.boxed_clone() } else if let Some(action) = self.action.as_ref() { action.boxed_clone() } else if let Some(action_name) = self.action_name { diff --git a/crates/vim/src/vim.rs b/crates/vim/src/vim.rs index 205b55f01d93951e0452a67760cf781e754f4188..860af285c42753ce0e6c559831f8f22745b6ed6d 100644 --- a/crates/vim/src/vim.rs +++ b/crates/vim/src/vim.rs @@ -1781,14 +1781,16 @@ impl Vim { let newest = editor.read(cx).selections.newest_anchor().clone(); let is_multicursor = editor.read(cx).selections.count() > 1; if self.mode == Mode::Insert && self.current_tx.is_some() { - if self.current_anchor.is_none() { + if let Some(current_anchor) = &self.current_anchor { + if current_anchor != &newest + && let Some(tx_id) = self.current_tx.take() + { + self.update_editor(cx, |_, editor, cx| { + editor.group_until_transaction(tx_id, cx) + }); + } + } else { self.current_anchor = Some(newest); - } else if self.current_anchor.as_ref().unwrap() != &newest - && let Some(tx_id) = self.current_tx.take() - { - self.update_editor(cx, |_, editor, cx| { - editor.group_until_transaction(tx_id, cx) - }); } } else if self.mode == Mode::Normal && newest.start != newest.end { if matches!(newest.goal, SelectionGoal::HorizontalRange { .. }) { diff --git a/flake.lock b/flake.lock index 561919d5745a2355aad14a4fe9972bf9fbf3d8d2..5bfb03ffd1a2e0a3d1d6ad706dfc68f46235dcb3 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1765145449, - "narHash": "sha256-aBVHGWWRzSpfL++LubA0CwOOQ64WNLegrYHwsVuVN7A=", + "lastModified": 1768873933, + "narHash": "sha256-CfyzdaeLNGkyAHp3kT5vjvXhA1pVVK7nyDziYxCPsNk=", "owner": "ipetkov", "repo": "crane", - "rev": "69f538cdce5955fcd47abfed4395dc6d5194c1c5", + "rev": "0bda7e7d005ccb5522a76d11ccfbf562b71953ca", "type": "github" }, "original": { @@ -17,11 +17,11 @@ }, "flake-compat": { "locked": { - "lastModified": 1765121682, - "narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=", + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", "owner": "edolstra", "repo": "flake-compat", - "rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", "type": "github" }, "original": { @@ -32,11 +32,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1765772535, - "narHash": "sha256-I715zWsdVZ+CipmLtoCAeNG0etQywiWRE5PaWntnaYk=", - "rev": "09b8fda8959d761445f12b55f380d90375a1d6bb", + "lastModified": 1768875095, + "narHash": "sha256-XH6awru9NnBc/m+2YhRNT8r1PAKEiPGF3gs//F3ods0=", + "rev": "ed142ab1b3a092c4d149245d0c4126a5d7ea00b0", "type": "tarball", - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre911985.09b8fda8959d/nixexprs.tar.xz" + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre930822.ed142ab1b3a0/nixexprs.tar.xz" }, "original": { "type": "tarball", @@ -53,14 +53,16 @@ }, "rust-overlay": { "inputs": { - "nixpkgs": ["nixpkgs"] + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1765465581, - "narHash": "sha256-fCXT0aZXmTalM3NPCTedVs9xb0egBG5BOZkcrYo5PGE=", + "lastModified": 1769136478, + "narHash": "sha256-8UNd5lmGf8phCr/aKxagJ4kNsF0pCHLish2G4ZKCFFY=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "99cc5667eece98bb35dcf35f7e511031a8b7a125", + "rev": "470ee44393bb19887056b557ea2c03fc5230bd5a", "type": "github" }, "original": { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e7cc22421d71ba35b592dd2163da1927c4abf118..3d058f5212a09b1a38c03a1b19ed5ccfb802e95f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.92" +channel = "1.93" profile = "minimal" components = [ "rustfmt", "clippy" ] targets = [