From 3a522af0670286cd8a3427fe10d6349417b81391 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 13 Oct 2026 21:06:39 +0200 Subject: [PATCH] Launcher: fix clippy's 7 warnings (unused re-exports, complex markdown types, large Err in send closures) Behaviour is unchanged: the threads still ignore a closed channel. Co-Authored-By: Claude Opus 5.5 --- launcher/src/main.rs | 16 ++++++++++++---- launcher/src/markdown.rs | 17 +++++++++++------ launcher/src/theme.rs | 4 ++-- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 80aeebbc7..f1445be6a 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -246,7 +246,9 @@ impl Launcher { fn check_updates(&mut self) { self.checked = Some(Instant::now()); let tx = self.tx.clone(); - std::thread::spawn(move || tx.send(Msg::Updates(backend::check_updates()))); + std::thread::spawn(move || { + let _ = tx.send(Msg::Updates(backend::check_updates())); + }); } fn update_launcher(&mut self, release: Release) { @@ -291,18 +293,24 @@ impl Launcher { fn fetch_releases(&mut self) { self.releases = Load::Loading; let tx = self.tx.clone(); - std::thread::spawn(move || tx.send(Msg::Releases(backend::releases()))); + std::thread::spawn(move || { + let _ = tx.send(Msg::Releases(backend::releases())); + }); } fn fetch_links(&self) { let tx = self.tx.clone(); - std::thread::spawn(move || tx.send(Msg::Links(backend::links()))); + std::thread::spawn(move || { + let _ = tx.send(Msg::Links(backend::links())); + }); } fn fetch_roadmap(&mut self) { self.roadmap = Load::Loading; let tx = self.tx.clone(); - std::thread::spawn(move || tx.send(Msg::Roadmap(backend::roadmap()))); + std::thread::spawn(move || { + let _ = tx.send(Msg::Roadmap(backend::roadmap())); + }); } fn drain(&mut self, cx: &mut Context) { diff --git a/launcher/src/markdown.rs b/launcher/src/markdown.rs index a71a0d49c..ee50f6470 100644 --- a/launcher/src/markdown.rs +++ b/launcher/src/markdown.rs @@ -7,13 +7,18 @@ use gpui::{ use pulldown_cmark::{Event, HeadingLevel, Options, Parser, Tag, TagEnd}; use std::ops::Range; +/// A run of text's styled ranges. +type Spans = Vec<(Range, Span)>; +/// A table row: each cell's text and its spans. +type Row = Vec<(String, Spans)>; + enum Block { - Heading(u8, String, Vec<(Range, Span)>), - Paragraph(String, Vec<(Range, Span)>), - Item(usize, Option, String, Vec<(Range, Span)>), + Heading(u8, String, Spans), + Paragraph(String, Spans), + Item(usize, Option, String, Spans), Code(String), Rule, - Table(Vec, Span)>)>>), + Table(Vec), } #[derive(Clone, Copy)] @@ -32,7 +37,7 @@ pub fn render(source: &str, t: &Theme) -> AnyElement { let mut item: Option<(usize, Option)> = None; let mut heading = None; let mut code: Option = None; - let mut table: Option, Span)>)>>> = None; + let mut table: Option> = None; let flush = |blocks: &mut Vec, text: &mut String, spans: &mut Vec<_>, @@ -134,7 +139,7 @@ pub fn render(source: &str, t: &Theme) -> AnyElement { } flush(&mut blocks, &mut text, &mut spans, &mut item, None); - let styled = |text: String, spans: Vec<(Range, Span)>| { + let styled = |text: String, spans: Spans| { let highlights = spans.into_iter().map(|(range, span)| { let style = match span { Span::Strong => HighlightStyle { diff --git a/launcher/src/theme.rs b/launcher/src/theme.rs index 13e570860..08f8741d7 100644 --- a/launcher/src/theme.rs +++ b/launcher/src/theme.rs @@ -17,8 +17,8 @@ pub const HERO: f32 = tokens::HERO; /// Shapes and controls, shared with the game's menus. pub use tokens::{ - CONTROL, CONTROL_LARGE, DISABLED, PRESSED, PRESSED_SOFT, PRIMARY_HOVER, RADIUS, RADIUS_CARD, - RADIUS_GROUP, RADIUS_SEGMENT, ROW_LABEL, SEGMENT, SIDEBAR, + CONTROL, DISABLED, PRESSED, PRESSED_SOFT, PRIMARY_HOVER, RADIUS, RADIUS_GROUP, RADIUS_SEGMENT, + ROW_LABEL, SEGMENT, SIDEBAR, }; /// Motion: short and eased out, never bouncy.