From 2b21ff1d805a2712c6fe420ce8cb76fb4fccc570 Mon Sep 17 00:00:00 2001 From: devmobasa <4170275+devmobasa@users.noreply.github.com> Date: Mon, 26 Oct 2026 12:46:35 +0100 Subject: [PATCH] style: enable clippy::doc_markdown Put identifiers and Wayland protocol names in doc comments in backticks (`wl_output`, `zwp_tablet_v2`). Product names that docs write plainly (GLib, HarfBuzz, HiDPI, JetBrains, MSBuild, StatusNotifierItem, VSync) go in `doc-valid-idents` in clippy.toml, next to Clippy's default list. Mechanical, with the lint enabled in Cargo.toml: cargo clippy --fix --workspace --all-targets --all-features cargo clippy --fix --workspace --all-targets --no-default-features cargo fmt --all Two comments that the fix could not mark up cleanly were reworded by hand: the surface module summary and the zoom-chip invariant. --- Cargo.toml | 1 + clippy.toml | 4 ++++ configurator/src/app/component.rs | 2 +- configurator/src/app/pages/keybindings/widgets.rs | 2 +- src/backend/wayland/frozen/image.rs | 2 +- src/backend/wayland/frozen_geometry.rs | 2 +- src/backend/wayland/handlers/tablet/mod.rs | 2 +- .../wayland/input_monitor/monitor/worker/tests.rs | 2 +- src/backend/wayland/session.rs | 2 +- src/backend/wayland/state/buffer_damage.rs | 10 +++++----- src/backend/wayland/state/capture.rs | 2 +- .../wayland/state/region_capture/delivery.rs | 2 +- src/backend/wayland/state/render/profile.rs | 2 +- src/backend/wayland/state/render/tool_preview.rs | 2 +- src/backend/wayland/surface.rs | 8 ++++---- src/backend/wayland/tablet_types.rs | 6 +++--- src/backend/wayland/toolbar/hit.rs | 2 +- src/backend/wayland/toolbar/layout/mod.rs | 2 +- .../wayland/toolbar/render/widgets/buttons.rs | 2 +- src/backend/wayland/toolbar/surfaces/lifecycle.rs | 2 +- src/backend/wayland/toolbar/view/top.rs | 2 +- src/backend/wayland/toolbar/view/top/menus.rs | 2 +- src/backend/wayland/toolbar_intent.rs | 2 +- src/config/tests/document.rs | 2 +- src/config/types/tablet.rs | 4 ++-- src/config/types/ui.rs | 2 +- src/desktop_open.rs | 2 +- src/draw/frame/core.rs | 2 +- src/input/state/actions/key_press/mod.rs | 2 +- src/input/state/core/color_picker_popup/state.rs | 2 +- src/input/state/core/editing.rs | 2 +- src/input/state/core/index/grid.rs | 8 ++++---- src/input/state/core/radial_menu/mod.rs | 2 +- src/input/state/core/selection.rs | 6 +++--- src/input/state/core/test_support.rs | 4 ++-- src/input/state/mouse/press.rs | 2 +- src/input/state/tests/text_input/ime.rs | 2 +- src/session/snapshot/compat_tests.rs | 2 +- .../capture_suppression/tests/wayland_proxy.rs | 2 +- src/toolbar_gtk/view/top_bar/controls.rs | 2 +- src/toolbar_gtk/widgets.rs | 2 +- src/ui/board_picker/page_panel/thumbnail/icons.rs | 2 +- src/ui/color_picker_popup.rs | 2 +- src/ui/context_menu.rs | 2 +- src/ui/radial_menu/mod.rs | 2 +- src/ui/status/zoom_chip.rs | 14 +++++++------- src/ui/theme.rs | 2 +- src/ui/toolbar/events.rs | 2 +- src/ui/toolbar/model/style_pill.rs | 6 +++--- src/ui/toolbar/snapshot/types.rs | 2 +- 50 files changed, 77 insertions(+), 72 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 97777a39..c86b5a6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ wildcard_imports = "warn" # Pedantic lints, adopted one at a time. Most of them have machine-applicable # fixes, so `cargo clippy --fix` can apply them. cast_lossless = "warn" +doc_markdown = "warn" map_unwrap_or = "warn" uninlined_format_args = "warn" diff --git a/clippy.toml b/clippy.toml index ffaa221b..741b6353 100644 --- a/clippy.toml +++ b/clippy.toml @@ -14,3 +14,7 @@ disallowed-methods = [ { path = "std::sync::Mutex::clear_poison", reason = "a poisoned lock may hold broken invariants" }, { path = "std::sync::RwLock::clear_poison", reason = "a poisoned lock may hold broken invariants" }, ] + +# Product and library names that docs may write without backticks. The `..` +# keeps Clippy's default list. +doc-valid-idents = ["GLib", "HarfBuzz", "HiDPI", "JetBrains", "MSBuild", "StatusNotifierItem", "VSync", ".."] diff --git a/configurator/src/app/component.rs b/configurator/src/app/component.rs index 49c939ea..6f7c95bd 100644 --- a/configurator/src/app/component.rs +++ b/configurator/src/app/component.rs @@ -40,7 +40,7 @@ fn load_app_stylesheet() { } } -/// GApplication id. A valid dotted id is required by GLib; the window still +/// `GApplication` id. A valid dotted id is required by GLib; the window still /// advertises this as its Wayland app-id, so compositor rules and the /// `.desktop` `StartupWMClass` must match it. const APP_ID: &str = "org.wayscriber.Configurator"; diff --git a/configurator/src/app/pages/keybindings/widgets.rs b/configurator/src/app/pages/keybindings/widgets.rs index d15af9c0..8d30908a 100644 --- a/configurator/src/app/pages/keybindings/widgets.rs +++ b/configurator/src/app/pages/keybindings/widgets.rs @@ -77,7 +77,7 @@ pub(super) fn connect_clicked( }); } -/// GtkPopover widgets created with `set_parent` are not ordinary children. +/// `GtkPopover` widgets created with `set_parent` are not ordinary children. /// If they are still attached when the parent is destroyed, GTK warns on /// finalize. Unparent in the destroy handler so shutdown stays quiet. pub(super) fn unparent_on_destroy(parent: &impl IsA, popover: >k::Popover) { diff --git a/src/backend/wayland/frozen/image.rs b/src/backend/wayland/frozen/image.rs index a79e9267..41c13bb7 100644 --- a/src/backend/wayland/frozen/image.rs +++ b/src/backend/wayland/frozen/image.rs @@ -51,7 +51,7 @@ pub(in crate::backend::wayland) fn validate_shm_buffer_layout( } impl FrozenImage { - /// Apply the wl_output transform advertised for the captured output. + /// Apply the `wl_output` transform advertised for the captured output. /// /// WLR screencopy buffers are returned in output framebuffer coordinates. /// Frozen/zoom rendering paints them onto a logical surface, so rotated or diff --git a/src/backend/wayland/frozen_geometry.rs b/src/backend/wayland/frozen_geometry.rs index 477f0578..1dd569fd 100644 --- a/src/backend/wayland/frozen_geometry.rs +++ b/src/backend/wayland/frozen_geometry.rs @@ -547,7 +547,7 @@ impl OutputGeometry { /// Crop origin inside a portal/desktop screenshot of `image_width` × /// `image_height`. /// - /// Prefer the walked layout origin. If optional zxdg_output metadata is + /// Prefer the walked layout origin. If optional `zxdg_output` metadata is /// missing, `(0, 0)` is inferred only when topology proves there is a /// single output and the image is that output's physical size. pub fn portal_crop_origin(&self, image_width: u32, image_height: u32) -> Option<(u32, u32)> { diff --git a/src/backend/wayland/handlers/tablet/mod.rs b/src/backend/wayland/handlers/tablet/mod.rs index 64bbe91d..441302e5 100644 --- a/src/backend/wayland/handlers/tablet/mod.rs +++ b/src/backend/wayland/handlers/tablet/mod.rs @@ -1,4 +1,4 @@ -//! Wayland tablet/stylus protocol handling (zwp_tablet_v2). +//! Wayland tablet/stylus protocol handling (`zwp_tablet_v2`). use std::os::fd::OwnedFd; use std::sync::Arc; diff --git a/src/backend/wayland/input_monitor/monitor/worker/tests.rs b/src/backend/wayland/input_monitor/monitor/worker/tests.rs index 7c0c3dfe..ffb01a10 100644 --- a/src/backend/wayland/input_monitor/monitor/worker/tests.rs +++ b/src/backend/wayland/input_monitor/monitor/worker/tests.rs @@ -123,7 +123,7 @@ fn default_keymap() -> Option { xkb::Keymap::new_from_names(&context, "", "", "", "", None, xkb::KEYMAP_COMPILE_NO_FLAGS) } -/// evdev KEY_LEFTCTRL. +/// evdev `KEY_LEFTCTRL`. const CTRL_KEYCODE: u32 = 29; /// A press/release pair is reported to xkb once per *keycode*, not once diff --git a/src/backend/wayland/session.rs b/src/backend/wayland/session.rs index ec58188b..a4aa02f1 100644 --- a/src/backend/wayland/session.rs +++ b/src/backend/wayland/session.rs @@ -1,7 +1,7 @@ //! Session persistence bookkeeping for per-output snapshots. //! //! Tracks the current session options and whether a snapshot has been loaded -//! so WaylandState can coordinate persistence without storing extra fields. +//! so `WaylandState` can coordinate persistence without storing extra fields. use std::mem; diff --git a/src/backend/wayland/state/buffer_damage.rs b/src/backend/wayland/state/buffer_damage.rs index 8414094a..f0f09223 100644 --- a/src/backend/wayland/state/buffer_damage.rs +++ b/src/backend/wayland/state/buffer_damage.rs @@ -5,7 +5,7 @@ //! last displayed - not just regions from the current frame. //! //! This module tracks damage per buffer slot, identified by the canvas memory address. -//! SlotPool reuses the same memory regions for released buffers, so the pointer +//! `SlotPool` reuses the same memory regions for released buffers, so the pointer //! serves as a stable slot identifier across buffer reuse. //! //! A pool generation counter handles pool recreation (due to resize, scale change, @@ -105,7 +105,7 @@ pub(in crate::backend::wayland) struct BufferDamageReport { /// Tracks dirty regions for each buffer slot independently. /// /// Buffers are identified by their canvas memory address, which is stable -/// across SlotPool buffer reuse (the same memory slot gets the same pointer). +/// across `SlotPool` buffer reuse (the same memory slot gets the same pointer). /// Pool identity (generation + size) detects when the pool is recreated or /// grows, which invalidates all previous canvas pointers. /// @@ -141,7 +141,7 @@ impl BufferDamageTracker { /// Checks pool identity and resets tracking if pool was recreated or grew. /// - /// When the SlotPool is recreated (generation changes) or grows (size increases), + /// When the `SlotPool` is recreated (generation changes) or grows (size increases), /// all previous canvas pointers become invalid due to memory remapping. fn check_pool_identity(&mut self, generation: u64, pool_size: usize) { let pool_changed = generation != self.pool_generation; @@ -217,12 +217,12 @@ impl BufferDamageTracker { /// Takes damage regions for the buffer identified by its canvas pointer. /// /// The canvas pointer (memory address of the first byte) serves as a stable - /// slot identifier - SlotPool reuses the same memory for released buffers. + /// slot identifier - `SlotPool` reuses the same memory for released buffers. /// /// Pool identity (generation + size) is checked first - if the pool was /// recreated or grew, all tracking is reset since previous pointers are invalid. /// - /// If this is a new slot (or global_full_damage is set), returns full damage. + /// If this is a new slot (or `global_full_damage` is set), returns full damage. /// Otherwise returns and clears the slot's accumulated damage. pub fn take_buffer_damage_report( &mut self, diff --git a/src/backend/wayland/state/capture.rs b/src/backend/wayland/state/capture.rs index f5dd120a..ee34d3a1 100644 --- a/src/backend/wayland/state/capture.rs +++ b/src/backend/wayland/state/capture.rs @@ -157,7 +157,7 @@ impl WaylandState { self.exit_overlay_suppression(OverlaySuppression::DesktopBackdrop); } - /// Handles capture actions by delegating to the CaptureManager. + /// Handles capture actions by delegating to the `CaptureManager`. pub(in crate::backend::wayland) fn handle_capture_action(&mut self, action: Action) { if action.is_region_capture() { if let Some(opening_action) = self.capture.active_region_action() { diff --git a/src/backend/wayland/state/region_capture/delivery.rs b/src/backend/wayland/state/region_capture/delivery.rs index c2e4d489..b8064bea 100644 --- a/src/backend/wayland/state/region_capture/delivery.rs +++ b/src/backend/wayland/state/region_capture/delivery.rs @@ -211,7 +211,7 @@ impl WaylandState { /// Submit the whole displayed image and retire any in-flight drag owner. /// - /// Keeping this transaction on WaylandState leaves the keyboard protocol + /// Keeping this transaction on `WaylandState` leaves the keyboard protocol /// callback responsible only for translating Ctrl+A into one state action. pub(in crate::backend::wayland) fn submit_whole_region_capture(&mut self) { let Some(RegionSelectionFinalize::Selected { purpose, rect }) = diff --git a/src/backend/wayland/state/render/profile.rs b/src/backend/wayland/state/render/profile.rs index eac887de..711e9cdd 100644 --- a/src/backend/wayland/state/render/profile.rs +++ b/src/backend/wayland/state/render/profile.rs @@ -9,7 +9,7 @@ pub(super) enum ProfileMode { CanvasAndUi, } -/// The selected profile is a frame value; reusable baseline storage stays in RenderRuntime. +/// The selected profile is a frame value; reusable baseline storage stays in `RenderRuntime`. #[derive(Debug)] pub(super) struct FrameProfile { profile: Option, diff --git a/src/backend/wayland/state/render/tool_preview.rs b/src/backend/wayland/state/render/tool_preview.rs index 03dacf14..b3034a53 100644 --- a/src/backend/wayland/state/render/tool_preview.rs +++ b/src/backend/wayland/state/render/tool_preview.rs @@ -315,7 +315,7 @@ mod tests { assert!(by + bubble_h <= 600.0, "clamped within bottom edge"); } - /// Little-endian ARgb32 stores premultiplied BGRA in memory. + /// Little-endian `ARgb32` stores premultiplied BGRA in memory. fn has_strong_green_pixel(pixels: &[u8]) -> bool { pixels.as_chunks::<4>().0.iter().any(|px| { let (b, g, r, a) = (px[0], px[1], px[2], px[3]); diff --git a/src/backend/wayland/surface.rs b/src/backend/wayland/surface.rs index 42bc6c33..cfaa1fb8 100644 --- a/src/backend/wayland/surface.rs +++ b/src/backend/wayland/surface.rs @@ -1,7 +1,7 @@ //! Layer-surface management for the Wayland backend. //! -//! This module owns the wl_surface/layer surface handle and the shm slot -//! pool. WaylandState asks SurfaceState for buffers and size information +//! This module owns the `wl_surface`, its layer-surface handle, and the shm slot +//! pool. `WaylandState` asks `SurfaceState` for buffers and size information //! instead of juggling the raw objects directly. use anyhow::{Context, Result}; @@ -152,12 +152,12 @@ impl SurfaceState { self.frame_callbacks.clear(); } - /// Returns the active wl_surface, if initialized. + /// Returns the active `wl_surface`, if initialized. pub fn wl_surface(&self) -> Option<&wl_surface::WlSurface> { self.wl_surface.as_ref() } - /// Returns true if the provided wl_surface belongs to this overlay surface state. + /// Returns true if the provided `wl_surface` belongs to this overlay surface state. pub fn is_surface(&self, surface: &wl_surface::WlSurface) -> bool { self.wl_surface .as_ref() diff --git a/src/backend/wayland/tablet_types.rs b/src/backend/wayland/tablet_types.rs index fea3eef8..00821481 100644 --- a/src/backend/wayland/tablet_types.rs +++ b/src/backend/wayland/tablet_types.rs @@ -1,8 +1,8 @@ use wayland_protocols::wp::tablet::zv2::client::zwp_tablet_tool_v2::Type; -/// Physical tool types as defined by the zwp_tablet_tool_v2 protocol. +/// Physical tool types as defined by the `zwp_tablet_tool_v2` protocol. /// -/// See: https://wayland.app/protocols/tablet-v2#zwp_tablet_tool_v2:enum:type +/// See: #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum TabletToolType { /// Pen tool (0x140) @@ -43,7 +43,7 @@ impl TabletToolType { /// Protocol value for lens tool const LENS_VALUE: u32 = 0x147; - /// Converts from the raw u32 protocol value to TabletToolType. + /// Converts from the raw u32 protocol value to `TabletToolType`. pub fn from_raw(value: u32) -> Self { match value { Self::PEN_VALUE => TabletToolType::Pen, diff --git a/src/backend/wayland/toolbar/hit.rs b/src/backend/wayland/toolbar/hit.rs index c736c051..f72f3d96 100644 --- a/src/backend/wayland/toolbar/hit.rs +++ b/src/backend/wayland/toolbar/hit.rs @@ -27,7 +27,7 @@ pub struct HitRegion { const ROW_HIT_LENGTH: f64 = MIN_HIT_TARGET * 3.0; /// Shared pointer-target predicate: true when (x, y) lands inside `rect` -/// inflated to the minimum target size. Used by both the legacy HitRegion +/// inflated to the minimum target size. Used by both the legacy `HitRegion` /// path and the view-engine tree so the two can never disagree. pub fn rect_contains_with_min_target(rect: (f64, f64, f64, f64), x: f64, y: f64) -> bool { let (rx, ry, rw, rh) = rect_with_min_target(rect); diff --git a/src/backend/wayland/toolbar/layout/mod.rs b/src/backend/wayland/toolbar/layout/mod.rs index 144f7fef..616ea662 100644 --- a/src/backend/wayland/toolbar/layout/mod.rs +++ b/src/backend/wayland/toolbar/layout/mod.rs @@ -15,7 +15,7 @@ pub fn top_size(engine: &UiTextEngine, snapshot: &ToolbarSnapshot) -> (u32, u32) } /// Scroll bounds for the open Canvas/Session/Settings popover on the top strip as -/// (natural_height, viewport_height), both in pre-scale spec units; `None` +/// (`natural_height`, `viewport_height`), both in pre-scale spec units; `None` /// while no menu popover is open. pub fn top_popover_scroll_bounds( engine: &UiTextEngine, diff --git a/src/backend/wayland/toolbar/render/widgets/buttons.rs b/src/backend/wayland/toolbar/render/widgets/buttons.rs index c53a57a5..c3b4bcae 100644 --- a/src/backend/wayland/toolbar/render/widgets/buttons.rs +++ b/src/backend/wayland/toolbar/render/widgets/buttons.rs @@ -16,7 +16,7 @@ use crate::ui_text::{UiTextEngine, UiTextStyle}; use std::f64::consts::PI; /// Faint white glow behind a hovered flat button (quieter than -/// COLOR_ICON_HOVER_BG; value-coincides with COLOR_DIVIDER but is a hover +/// `COLOR_ICON_HOVER_BG`; value-coincides with `COLOR_DIVIDER` but is a hover /// affordance, not a separator). const COLOR_BUTTON_HOVER_GLOW: Rgba = (1.0, 1.0, 1.0, 0.08); /// Warning-tinted glow behind a hovered destructive button (destructive diff --git a/src/backend/wayland/toolbar/surfaces/lifecycle.rs b/src/backend/wayland/toolbar/surfaces/lifecycle.rs index 00aa6b65..86bb6446 100644 --- a/src/backend/wayland/toolbar/surfaces/lifecycle.rs +++ b/src/backend/wayland/toolbar/surfaces/lifecycle.rs @@ -56,7 +56,7 @@ impl ToolbarSurface { self.configured = false; } - /// Resize an already-mapped surface in place via layer_surface.set_size + /// Resize an already-mapped surface in place via `layer_surface.set_size` /// instead of destroy/recreate, so size changes (shape picker, drawer, /// contextual sections) don't flicker. Rendering pauses until the /// compositor acks with a new configure. diff --git a/src/backend/wayland/toolbar/view/top.rs b/src/backend/wayland/toolbar/view/top.rs index f82a1f06..f493a8d4 100644 --- a/src/backend/wayland/toolbar/view/top.rs +++ b/src/backend/wayland/toolbar/view/top.rs @@ -357,7 +357,7 @@ pub fn top_extra_height(engine: &UiTextEngine, snapshot: &ToolbarSnapshot) -> f6 } /// Scroll bounds for the open Canvas/Session/Settings popover as -/// (natural_height, viewport_height), both in pre-scale spec units; `None` +/// (`natural_height`, `viewport_height`), both in pre-scale spec units; `None` /// while no menu popover is open. The wheel path and scrollbar drag use these /// same bounds. pub fn top_popover_scroll_bounds( diff --git a/src/backend/wayland/toolbar/view/top/menus.rs b/src/backend/wayland/toolbar/view/top/menus.rs index fb391a78..2826c10d 100644 --- a/src/backend/wayland/toolbar/view/top/menus.rs +++ b/src/backend/wayland/toolbar/view/top/menus.rs @@ -125,7 +125,7 @@ fn menu_viewport_cap(snapshot: &ToolbarSnapshot, plan: &super::TopStripPlan) -> } /// Scroll bounds for the open Canvas/Session/Settings popover as -/// (natural_height, viewport_height), both in pre-scale spec units; `None` +/// (`natural_height`, `viewport_height`), both in pre-scale spec units; `None` /// while no menu popover is open. Max scroll = (natural - viewport).max(0). pub(super) fn menu_scroll_bounds_planned( engine: &UiTextEngine, diff --git a/src/backend/wayland/toolbar_intent.rs b/src/backend/wayland/toolbar_intent.rs index ae54f6d2..37a0730d 100644 --- a/src/backend/wayland/toolbar_intent.rs +++ b/src/backend/wayland/toolbar_intent.rs @@ -10,7 +10,7 @@ impl ToolbarIntent { } } -/// Translate a backend intent into the UI-facing ToolbarEvent. Snapshot is +/// Translate a backend intent into the UI-facing `ToolbarEvent`. Snapshot is /// available for future context-sensitive mapping. pub fn intent_to_event(intent: ToolbarIntent, _snapshot: Option<&ToolbarSnapshot>) -> ToolbarEvent { let _ = _snapshot; diff --git a/src/config/tests/document.rs b/src/config/tests/document.rs index e25680bf..2ec910e3 100644 --- a/src/config/tests/document.rs +++ b/src/config/tests/document.rs @@ -2500,7 +2500,7 @@ enabled = true /// The historical `full` alias for the regular mode table must keep its /// authored spelling on an unrelated save, and the retired nested field must -/// classify under the path serde_ignored actually emits. +/// classify under the path `serde_ignored` actually emits. #[test] fn retired_full_alias_show_settings_section_is_diagnosed_and_spelling_preserved() { let temp = TempConfig::new("retired-full-alias"); diff --git a/src/config/types/tablet.rs b/src/config/types/tablet.rs index 3b15cad7..ed026c29 100644 --- a/src/config/types/tablet.rs +++ b/src/config/types/tablet.rs @@ -55,11 +55,11 @@ pub struct TabletInputConfig { #[serde(default = "default_pressure_thickness_scale_step")] pub pressure_thickness_scale_step: f64, - /// Binding for the primary barrel button (BTN_STYLUS / button 331). + /// Binding for the primary barrel button (`BTN_STYLUS` / button 331). #[serde(default = "default_stylus_button")] pub stylus_button: StylusButtonBinding, - /// Binding for the secondary barrel button (BTN_STYLUS2 / button 332). + /// Binding for the secondary barrel button (`BTN_STYLUS2` / button 332). #[serde(default = "default_stylus_button2")] pub stylus_button2: StylusButtonBinding, } diff --git a/src/config/types/ui.rs b/src/config/types/ui.rs index 39c4d920..a08c190d 100644 --- a/src/config/types/ui.rs +++ b/src/config/types/ui.rs @@ -94,7 +94,7 @@ pub struct UiConfig { pub show_floating_badge: bool, /// Show the board/page badge even when the status bar is visible - /// (renamed from show_page_badge_with_status_bar for clarity) + /// (renamed from `show_page_badge_with_status_bar` for clarity) #[serde( default = "default_show_page_badge_with_status_bar", alias = "show_page_badge_with_status_bar" diff --git a/src/desktop_open.rs b/src/desktop_open.rs index 68fef741..1957f837 100644 --- a/src/desktop_open.rs +++ b/src/desktop_open.rs @@ -75,7 +75,7 @@ pub(crate) fn open(invocation: &DesktopOpenInvocation) -> Result<()> { } /// Spawn a desktop opener without blocking the Wayland or tray callback that -/// requested it. The broker still authorizes the argv; DetachedAfterExec keeps +/// requested it. The broker still authorizes the argv; `DetachedAfterExec` keeps /// the launched application alive after this process exits. /// /// Callers that own the process broker must join the returned worker before diff --git a/src/draw/frame/core.rs b/src/draw/frame/core.rs index 1ac8691e..cbad6ffa 100644 --- a/src/draw/frame/core.rs +++ b/src/draw/frame/core.rs @@ -85,7 +85,7 @@ impl Frame { frame } - /// Copy exactly the newest undo/redo entries retained by clamp_history_depth, + /// Copy exactly the newest undo/redo entries retained by `clamp_history_depth`, /// without first allocating copies of discarded actions or their payloads. #[must_use] pub fn clone_with_history_limit(&self, limit: usize) -> Self { diff --git a/src/input/state/actions/key_press/mod.rs b/src/input/state/actions/key_press/mod.rs index bb9b000c..80ce088d 100644 --- a/src/input/state/actions/key_press/mod.rs +++ b/src/input/state/actions/key_press/mod.rs @@ -40,7 +40,7 @@ impl InputState { /// Handles all keyboard input including: /// - Drawing color selection (configurable keybindings) /// - Tool actions (text mode, clear, undo - configurable) - /// - Text input (when in TextInput state) + /// - Text input (when in `TextInput` state) /// - Exit commands (configurable) /// - Thickness adjustment (configurable) /// - Help toggle (configurable) diff --git a/src/input/state/core/color_picker_popup/state.rs b/src/input/state/core/color_picker_popup/state.rs index 5cfba8d1..5d6472da 100644 --- a/src/input/state/core/color_picker_popup/state.rs +++ b/src/input/state/core/color_picker_popup/state.rs @@ -1,4 +1,4 @@ -//! Color picker popup state methods for InputState. +//! Color picker popup state methods for `InputState`. use crate::draw::TextMeasurer; use std::borrow::Cow; diff --git a/src/input/state/core/editing.rs b/src/input/state/core/editing.rs index d2b41d30..223ecc9b 100644 --- a/src/input/state/core/editing.rs +++ b/src/input/state/core/editing.rs @@ -1,4 +1,4 @@ -//! Canvas mutation transactions. InputState applies UI and persistence effects. +//! Canvas mutation transactions. `InputState` applies UI and persistence effects. use std::collections::HashSet; use crate::draw::frame::{Frame, ShapeSnapshot, UndoAction}; diff --git a/src/input/state/core/index/grid.rs b/src/input/state/core/index/grid.rs index 5816a5ca..8ab6238e 100644 --- a/src/input/state/core/index/grid.rs +++ b/src/input/state/core/index/grid.rs @@ -32,16 +32,16 @@ enum CellCoverage { Global, } -/// Spatial grid for efficient hit-testing using ShapeId instead of indices. +/// Spatial grid for efficient hit-testing using `ShapeId` instead of indices. /// /// This allows incremental updates when shapes are added, removed, or modified /// without needing to rebuild the entire grid. #[derive(Debug, Clone)] pub(in crate::input::state::core) struct SpatialGrid { cell_size: i32, - /// Maps cell coordinates to the ShapeIds contained in that cell. + /// Maps cell coordinates to the `ShapeIds` contained in that cell. cells: HashMap<(i32, i32), Vec>, - /// Reverse mapping from ShapeId to the cells it occupies for efficient removal. + /// Reverse mapping from `ShapeId` to the cells it occupies for efficient removal. shape_cells: HashMap>, /// Shapes kept as global candidates because their coverage is unsafe or /// oversized, or because the aggregate membership budget is exhausted. @@ -199,7 +199,7 @@ impl SpatialGrid { } } - /// Queries for all ShapeIds in cells near the given point with tolerance-aware radius. + /// Queries for all `ShapeIds` in cells near the given point with tolerance-aware radius. /// /// The search radius is expanded based on tolerance to ensure shapes that could /// be hit within the tolerance distance are not missed. diff --git a/src/input/state/core/radial_menu/mod.rs b/src/input/state/core/radial_menu/mod.rs index cce7760a..d3bb8064 100644 --- a/src/input/state/core/radial_menu/mod.rs +++ b/src/input/state/core/radial_menu/mod.rs @@ -60,7 +60,7 @@ pub enum RadialMenuState { /// Identifies a segment in the radial menu for hit-testing. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum RadialSegmentId { - /// Primary compass-ring segment (index 0..TOOL_SEGMENT_COUNT, N = 0, + /// Primary compass-ring segment (index `0..TOOL_SEGMENT_COUNT`, N = 0, /// clockwise). Tool(u8), /// Sub-ring child segment (parent index, child index). diff --git a/src/input/state/core/selection.rs b/src/input/state/core/selection.rs index ebab8e01..ddef539e 100644 --- a/src/input/state/core/selection.rs +++ b/src/input/state/core/selection.rs @@ -25,7 +25,7 @@ enum SelectionState { None, Active { shape_ids: Vec, - /// Cached HashSet for O(1) membership tests during rendering. + /// Cached `HashSet` for O(1) membership tests during rendering. shape_ids_set: HashSet, }, } @@ -156,8 +156,8 @@ impl InputState { self.selection_interaction.selected_shape_ids() } - /// Returns a reference to the cached HashSet of selected shape IDs. - /// Use this for O(1) membership tests instead of creating a new HashSet. + /// Returns a reference to the cached `HashSet` of selected shape IDs. + /// Use this for O(1) membership tests instead of creating a new `HashSet`. pub fn selected_shape_ids_set(&self) -> Option<&HashSet> { self.selection_interaction.selected_shape_ids_set() } diff --git a/src/input/state/core/test_support.rs b/src/input/state/core/test_support.rs index 89abb0f9..80c42783 100644 --- a/src/input/state/core/test_support.rs +++ b/src/input/state/core/test_support.rs @@ -10,7 +10,7 @@ use crate::input::boards::PendingBoardRuntimeUiAction; impl InputState { /// Test convenience for inspecting shortcut edits. Production drains the - /// ordered InputEffect stream and forwards edits to the config worker. + /// ordered `InputEffect` stream and forwards edits to the config worker. pub(crate) fn take_pending_keybinding_edits(&mut self) -> Vec { self.input_effects .drain_all(InputEffectKind::KeybindingEdit) @@ -22,7 +22,7 @@ impl InputState { .collect() } - /// Test convenience for inspecting board actions in the InputEffect stream. + /// Test convenience for inspecting board actions in the `InputEffect` stream. pub(crate) fn take_pending_board_runtime_ui_actions( &mut self, ) -> Vec { diff --git a/src/input/state/mouse/press.rs b/src/input/state/mouse/press.rs index b36277c4..80474cf3 100644 --- a/src/input/state/mouse/press.rs +++ b/src/input/state/mouse/press.rs @@ -114,7 +114,7 @@ impl InputState { /// /// # Behavior /// - Left click while Idle: Starts drawing with the current tool (based on modifiers) - /// - Left click during TextInput: Updates text position + /// - Left click during `TextInput`: Updates text position /// - Right click: Cancels current action #[allow(dead_code)] // Retained for older callers that only have canvas coordinates. pub fn on_mouse_press(&mut self, button: MouseButton, x: i32, y: i32) { diff --git a/src/input/state/tests/text_input/ime.rs b/src/input/state/tests/text_input/ime.rs index 0def3ce4..a29d11ea 100644 --- a/src/input/state/tests/text_input/ime.rs +++ b/src/input/state/tests/text_input/ime.rs @@ -1,4 +1,4 @@ -//! IME (zwp_text_input_v3) composition state-machine tests. These queue +//! IME (`zwp_text_input_v3`) composition state-machine tests. These queue //! composition events on `TextEditing`, apply each batch through the root //! `ime_apply_done` coordinator, and assert the caret-aware editor buffer and //! transient preedit follow the protocol's batch-then-done model. diff --git a/src/session/snapshot/compat_tests.rs b/src/session/snapshot/compat_tests.rs index 359f0416..0847c4d9 100644 --- a/src/session/snapshot/compat_tests.rs +++ b/src/session/snapshot/compat_tests.rs @@ -2,7 +2,7 @@ //! Sources: tag v0.9.25 and commit a2bb723a. The generator below was added to //! each archive as an integration test and run alone with //! `cargo test --locked --no-default-features -- --ignored --exact --test-threads=1`. -//! COMPAT_FIXTURE_OUT selected an empty output directory. The v0.9.25 generator omits +//! `COMPAT_FIXTURE_OUT` selected an empty output directory. The v0.9.25 generator omits //! BoardSnapshot.appearance because that revision does not have the field. //! //! Historical fixture generator: diff --git a/src/toolbar_gtk/view/capture_suppression/tests/wayland_proxy.rs b/src/toolbar_gtk/view/capture_suppression/tests/wayland_proxy.rs index d01ce589..de7a528a 100644 --- a/src/toolbar_gtk/view/capture_suppression/tests/wayland_proxy.rs +++ b/src/toolbar_gtk/view/capture_suppression/tests/wayland_proxy.rs @@ -1,6 +1,6 @@ //! Runs one GTK test behind a private headless Weston with one frame event withheld. //! -//! All protocol messages and SCM_RIGHTS descriptors pass through unchanged, except +//! All protocol messages and `SCM_RIGHTS` descriptors pass through unchanged, except //! the selected popup callback and its `delete_id` event. The protocol tables //! compiled into `wayland-client` and `wayland-protocols` provide opcodes and //! new-object types; this fixture neither renders nor invents feedback. diff --git a/src/toolbar_gtk/view/top_bar/controls.rs b/src/toolbar_gtk/view/top_bar/controls.rs index b032b4be..f84250ec 100644 --- a/src/toolbar_gtk/view/top_bar/controls.rs +++ b/src/toolbar_gtk/view/top_bar/controls.rs @@ -247,7 +247,7 @@ impl TopBar { /// A presets-island slot button: a filled slot draws the saved tool /// glyph in the neutral foreground with the preset color as a separate - /// corner swatch in a DrawingArea child, so a dark preset color never + /// corner swatch in a `DrawingArea` child, so a dark preset color never /// renders the glyph invisible against the slot body. An empty slot shows /// its 1-based number as a plain label. /// Clicking applies a filled slot or saves the current setup into an empty diff --git a/src/toolbar_gtk/widgets.rs b/src/toolbar_gtk/widgets.rs index a3bbadec..8f627614 100644 --- a/src/toolbar_gtk/widgets.rs +++ b/src/toolbar_gtk/widgets.rs @@ -259,7 +259,7 @@ fn release_window_keyboard_focus(widget: &impl IsA) { /// Whether a focus-widget change should drop the toolbar window's keyboard /// mode. Entries keep it: the editable hex field needs the keys it captures. /// Focus inside a popover keeps it too, for a different reason: the popover -/// is an xdg_popup holding a keyboard grab on its own surface. Dropping the +/// is an `xdg_popup` holding a keyboard grab on its own surface. Dropping the /// parent layer surface's keyboard mode there makes the compositor pull /// keyboard focus from the grabbing popup between a click's press and /// release, and that broken grab stalls the release — a Settings checkbox diff --git a/src/ui/board_picker/page_panel/thumbnail/icons.rs b/src/ui/board_picker/page_panel/thumbnail/icons.rs index 85dfe420..ebe73658 100644 --- a/src/ui/board_picker/page_panel/thumbnail/icons.rs +++ b/src/ui/board_picker/page_panel/thumbnail/icons.rs @@ -3,7 +3,7 @@ use std::f64::consts::PI; use crate::ui::constants::{self, TEXT_TERTIARY, TEXT_WHITE}; use crate::ui::theme::{ACCENT_RGB, Rgb}; -/// Delete-icon circle: softer than DESTRUCTIVE_RGB — the small filled disc +/// Delete-icon circle: softer than `DESTRUCTIVE_RGB` — the small filled disc /// reads harsh at full saturation (kept from the pre-theme literal). const DELETE_ICON_RGB: Rgb = (0.85, 0.2, 0.2); /// Rename-icon circle: neutral gray with no matching theme token. diff --git a/src/ui/color_picker_popup.rs b/src/ui/color_picker_popup.rs index 33409da3..b3d658ef 100644 --- a/src/ui/color_picker_popup.rs +++ b/src/ui/color_picker_popup.rs @@ -40,7 +40,7 @@ const INDICATOR_OUTLINE: Rgba = (0.0, 0.0, 0.0, 0.4); /// `theme::toolbar::COLOR_SWATCH_HAIRLINE_DARK`. const SWATCH_BORDER_ON_DARK: Rgba = (0.5, 0.5, 0.5, 0.8); const SWATCH_BORDER_ON_LIGHT: Rgba = (0.2, 0.2, 0.2, 0.6); -/// Validation-error red for the hex field (softer than DESTRUCTIVE_RGB). +/// Validation-error red for the hex field (softer than `DESTRUCTIVE_RGB`). const HEX_INVALID_GLOW: Rgba = (0.9, 0.3, 0.3, 0.25); const HEX_INVALID_BORDER: Rgba = (0.9, 0.35, 0.3, 0.9); /// Hex input border when unfocused. diff --git a/src/ui/context_menu.rs b/src/ui/context_menu.rs index 947cd914..33b430ef 100644 --- a/src/ui/context_menu.rs +++ b/src/ui/context_menu.rs @@ -9,7 +9,7 @@ use super::constants::{ RADIUS_PANEL, RADIUS_SM, SHADOW, TEXT_DISABLED, TEXT_HINT, TEXT_PRIMARY, }; -/// Footer hint text: slightly brighter than TEXT_TERTIARY so the key hints +/// Footer hint text: slightly brighter than `TEXT_TERTIARY` so the key hints /// stay legible inside the menu (kept from pre-theme literals). const HINT_FOOTER_TEXT: Rgba = (0.65, 0.68, 0.75, 1.0); /// Accent bar on the parent row of an open submenu. diff --git a/src/ui/radial_menu/mod.rs b/src/ui/radial_menu/mod.rs index ae17a7d5..a45d3306 100644 --- a/src/ui/radial_menu/mod.rs +++ b/src/ui/radial_menu/mod.rs @@ -665,7 +665,7 @@ fn draw_annular_sector( // ── Slice content resolution (ActionMeta registry) ── -/// Short label of a compass slice, resolved through the ActionMeta registry +/// Short label of a compass slice, resolved through the `ActionMeta` registry /// for action slices. fn slice_label(slice: &RadialSlice) -> &'static str { match slice.kind { diff --git a/src/ui/status/zoom_chip.rs b/src/ui/status/zoom_chip.rs index 6967e537..95b5951a 100644 --- a/src/ui/status/zoom_chip.rs +++ b/src/ui/status/zoom_chip.rs @@ -11,8 +11,8 @@ //! The zoom-out/in marks are drawn as bold vector +/- strokes (not circled //! glyphs), sized to the `NN%` digits and using the same adaptive chip color. //! Buttons dispatch through the shared zoom action path: -//! minus = ZoomOut, plus = ZoomIn, `Reset` = ResetZoom (back to 100%), and — only -//! while zoom is active — a compact `Lock` toggle = ToggleZoomLock. The `NN%` +//! minus = `ZoomOut`, plus = `ZoomIn`, `Reset` = `ResetZoom` (back to 100%), and — only +//! while zoom is active — a compact `Lock` toggle = `ToggleZoomLock`. The `NN%` //! readout is a passive display (it consumes clicks but triggers nothing), so //! no drag ever starts on the canvas beneath the chip. @@ -78,13 +78,13 @@ fn zoom_lock_label() -> &'static str { /// Interactive surface a zoom chip button activates on click. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ZoomChipButtonKind { - /// Bold vector minus mark — dispatches ZoomOut. + /// Bold vector minus mark — dispatches `ZoomOut`. Out, - /// Bold vector plus mark — dispatches ZoomIn. + /// Bold vector plus mark — dispatches `ZoomIn`. In, - /// `Reset` — dispatches ResetZoom (back to 100%). + /// `Reset` — dispatches `ResetZoom` (back to 100%). Reset, - /// `Lock` — dispatches ToggleZoomLock (present only while zoomed). + /// `Lock` — dispatches `ToggleZoomLock` (present only while zoomed). Lock, } @@ -1031,7 +1031,7 @@ mod tests { /// Reconciliation invariant (M8): outside Focus Mode, exactly one zoom-% /// indicator shows while zoomed in every - /// {show_zoom_actions}×{show_zoom_chip}×{show_status_bar} combination — + /// `show_zoom_actions` × `show_zoom_chip` × `show_status_bar` combination — /// never zero (the regression), never two. The chip and the status-HUD ZOOM /// badge come from their real layouts; the passive top-corner badge follows /// the backend render gate (`zoom_active && !show_status_bar && diff --git a/src/ui/theme.rs b/src/ui/theme.rs index b42bf885..179074a8 100644 --- a/src/ui/theme.rs +++ b/src/ui/theme.rs @@ -468,7 +468,7 @@ pub mod toolbar { /// Segmented control outer background pub const COLOR_SEGMENT_BG: Rgba = (0.15, 0.17, 0.22, 0.85); /// Active segment background: the accent at reduced alpha, deliberately - /// quieter than COLOR_ACCENT so segmented-control selection (Ico/Txt, + /// quieter than `COLOR_ACCENT` so segmented-control selection (Ico/Txt, /// Simple/Full) never competes with the active-tool highlight pub const COLOR_SEGMENT_ACTIVE: Rgba = rgba(ACCENT_RGB, 0.55); /// Active segment text color diff --git a/src/ui/toolbar/events.rs b/src/ui/toolbar/events.rs index 5b56454c..3ab204df 100644 --- a/src/ui/toolbar/events.rs +++ b/src/ui/toolbar/events.rs @@ -305,7 +305,7 @@ pub enum ToolbarEvent { /// Toggle page counter in the status bar ToggleStatusPageBadge(bool), /// Toggle the board/page badge when the status bar is visible - /// (renamed from TogglePageBadgeWithStatusBar for clarity) + /// (renamed from `TogglePageBadgeWithStatusBar` for clarity) ToggleFloatingBadgeAlways(bool), /// Set toolbar layout mode SetToolbarLayoutMode(ToolbarLayoutMode), diff --git a/src/ui/toolbar/model/style_pill.rs b/src/ui/toolbar/model/style_pill.rs index a031aebe..3aa0477e 100644 --- a/src/ui/toolbar/model/style_pill.rs +++ b/src/ui/toolbar/model/style_pill.rs @@ -152,12 +152,12 @@ pub(crate) enum StylePillControl { EraserModeSegment, /// Docked selection property rendered as a compact cycle button that /// shows the entry's value; clicking steps the property forward - /// through the properties apply machinery (Color, Fill, ArrowHead, - /// TextBackground). + /// through the properties apply machinery (Color, Fill, `ArrowHead`, + /// `TextBackground`). SelectionCycle(SelectionPropertyKind), /// Docked numeric selection property rendered as a −/value/+ stepper; /// the halves step the property through the properties apply - /// machinery (Thickness, FontSize, ArrowLength, ArrowAngle). The + /// machinery (Thickness, `FontSize`, `ArrowLength`, `ArrowAngle`). The /// machinery is relative (direction steps), so the pill uses steppers /// where the tool states use sliders. SelectionStepper(SelectionPropertyKind), diff --git a/src/ui/toolbar/snapshot/types.rs b/src/ui/toolbar/snapshot/types.rs index 037325b9..92d115f8 100644 --- a/src/ui/toolbar/snapshot/types.rs +++ b/src/ui/toolbar/snapshot/types.rs @@ -26,7 +26,7 @@ pub enum ToolOptionsKind { Shape, /// Arrow tool: thickness + labels toggle + counter Arrow, - /// StepMarker tool: size + counter + /// `StepMarker` tool: size + counter StepMarker, /// Spotlight tool: magnification only Spotlight,