diff --git a/crates/media/src/avi/mux.rs b/crates/media/src/avi/mux.rs index a6e03e174..60b28e039 100644 --- a/crates/media/src/avi/mux.rs +++ b/crates/media/src/avi/mux.rs @@ -383,7 +383,7 @@ fn hdrl(streams: &[StreamState], main: Option, max_riffs: u32, first_fram list(b"hdrl", &body) } -/// Writes an AVI file chunk by chunk; see the [module documentation](self). +/// Writes an AVI file chunk by chunk; see the [module documentation](crate::avi). #[derive(Debug)] pub struct AviWriter { w: W, diff --git a/crates/media/src/isobmff/codec/audio.rs b/crates/media/src/isobmff/codec/audio.rs index b3fce368e..06fa0e0a6 100644 --- a/crates/media/src/isobmff/codec/audio.rs +++ b/crates/media/src/isobmff/codec/audio.rs @@ -197,7 +197,7 @@ pub struct FlacConfig { } impl FlacConfig { - /// Parses the payload of the `dfLa` full box (version and flags first), keeping the metadata blocks and decoding STREAMINFO when present. Fails with [`Error::Truncated`] when a field runs past the end of `data`. + /// Parses the payload of the `dfLa` full box (version and flags first), keeping the metadata blocks and decoding STREAMINFO when present. Fails with [`crate::isobmff::Error::Truncated`] when a field runs past the end of `data`. pub fn parse(data: &[u8]) -> Result { let mut c = Cur::labeled(data, "dfLa"); c.full_header()?; diff --git a/crates/prepress/src/flatten/pdf.rs b/crates/prepress/src/flatten/pdf.rs index 3fcaa6d30..165b19bed 100644 --- a/crates/prepress/src/flatten/pdf.rs +++ b/crates/prepress/src/flatten/pdf.rs @@ -1333,8 +1333,3 @@ fn closed(path: &BezPath) -> BezPath { } out } - -#[cfg(test)] -mod tests { - use super::*; -} diff --git a/crates/raw/src/arw_lens.rs b/crates/raw/src/arw_lens.rs index d1ae6acd6..b42d3afe0 100644 --- a/crates/raw/src/arw_lens.rs +++ b/crates/raw/src/arw_lens.rs @@ -2,8 +2,8 @@ //! the raw image IFD's fields and their encrypted `SR2SubIFD` copies into [`SonyLensCorrections`], and validated //! ILCE-7RM4A, ILCE-7M3 and ILCE-7CR distortion tables into DNG warps for the shared optics pipeline. //! -//! Tag identity/layout: https://exiftool.org/TagNames/EXIF.html (`0x7031` to `0x7037`, signed shorts) and -//! https://exiftool.org/TagNames/Sony.html#SR2SubIFD (`0x797d`, `0x7980`, `0x7982`). The `SR2SubIFD` setting tags +//! Tag identity/layout: (`0x7031` to `0x7037`, signed shorts) and +//! (`0x797d`, `0x7980`, `0x7982`). The `SR2SubIFD` setting tags //! `0x797c`, `0x797f` and `0x7981` sit next to those tables, unnamed there; they equal the raw IFD's settings in every //! file inspected. Geometry inferred independently from files and Sony Imaging Edge exports; see //! docs/sony-lens-corrections.md. No lens database and no external decoder code. The MakerNote's similarly named diff --git a/crates/raw/src/preview.rs b/crates/raw/src/preview.rs index 6917d2588..ed5d4b5ef 100644 --- a/crates/raw/src/preview.rs +++ b/crates/raw/src/preview.rs @@ -385,8 +385,8 @@ pub struct PreviewRange { /// [`embedded_preview_from_range`], which returns exactly what [`embedded_preview`] returns for the /// whole file. /// -/// Pass a prefix that actually covers the pointer's range (read [`Self::offset`] + -/// [`Self::window_len`] bytes, or start with [`PREVIEW_PREFIX`] and grow when it is not enough): +/// Pass a prefix that actually covers the pointer's range (read [`PreviewRange::offset`] + +/// [`PreviewRange::window_len`] bytes, or start with [`PREVIEW_PREFIX`] and grow when it is not enough): /// `raf::header` clamps a slice to the buffer it was given, so a prefix that stops /// inside the declared extent yields a shorter `window_len` than the file really holds. pub fn bounded_preview(bytes: &[u8]) -> Option { diff --git a/crates/raw/src/rafc.rs b/crates/raw/src/rafc.rs index 2b3aa9a34..d8666138d 100644 --- a/crates/raw/src/rafc.rs +++ b/crates/raw/src/rafc.rs @@ -1,7 +1,7 @@ //! Fujifilm's striped predictive RAW compression. //! //! Clean-room implementation: Fabian's prose description of lossless RAF compression -//! (https://capnfabs.net/posts/fuji-raf-compression-algorithm/) supplied the broad structure; +//! () supplied the broad structure; //! headers, colour-vector placement, predictors, contexts and adaptation were recovered //! from sample bytes and black-box comparisons of decoded sensor arrays. No other RAW //! decoder's source was consulted. See docs/raf-compression.md for verification details. diff --git a/crates/table/src/ui/grid/input.rs b/crates/table/src/ui/grid/input.rs index 58331b25e..7658cc03c 100644 --- a/crates/table/src/ui/grid/input.rs +++ b/crates/table/src/ui/grid/input.rs @@ -129,7 +129,7 @@ impl ClaimedKeys { let escape = cx.take_claimed(ESCAPE); let advance = ADVANCES.iter().find_map(|&(chord, along, back)| cx.take_claimed(chord).then_some((along, back))); let f2 = cx.take_claimed(F2); - let edit_key = EDIT_KEYS.iter().fold(false, |any, &chord| cx.take_claimed(chord) || any); + let edit_key = EDIT_KEYS.iter().filter(|&&chord| cx.take_claimed(chord)).count() > 0; let mut arrows = Vec::new(); for shift in [false, true] { for (key, direction) in ARROWS { diff --git a/crates/ui-widgets/tests/it/body/settle.rs b/crates/ui-widgets/tests/it/body/settle.rs index cccbdc368..3fd56b7f3 100644 --- a/crates/ui-widgets/tests/it/body/settle.rs +++ b/crates/ui-widgets/tests/it/body/settle.rs @@ -205,7 +205,7 @@ fn a_child_with_a_running_animation_runs_every_frame() { #[non_exhaustive] enum Shown { #[command(label = "Shown", modal = "always")] - Shown, + Visible, #[command(label = "Beside", modal = "always")] Beside, #[command(label = "Measured", modal = "always")] @@ -252,7 +252,7 @@ impl CommandScene { in_region(ui, Rect::from_min_size(ORIGIN, ROOM), |ui| { Lazy::new("reader", 0.0).settles(true).show(ui, |ui| { self.runs[0].set(self.runs[0].get() + 1); - self.buttons[0].set(Button::command(Shown::Shown).show(ui).id); + self.buttons[0].set(Button::command(Shown::Visible).show(ui).id); self.buttons[2].set(Button::command(Scoped::Published).show(ui).id); Stack::new().sizing(Sizing::Content).id_salt("measured").show(ui, |ui, _| { self.buttons[3].set(Button::command(Shown::Measured).show(ui).id); @@ -295,7 +295,7 @@ fn an_app_command_state_runs_the_settled_child_that_shows_it() { let mut frames = Frames::new(); scene.settle(&mut frames); assert!(!scene.disabled(&mut frames, 0), "Shown starts enabled"); - let disable = |enabled: bool| CommandInput::new().state(Shown::Shown, CommandState::new().enabled(enabled)); + let disable = |enabled: bool| CommandInput::new().state(Shown::Visible, CommandState::new().enabled(enabled)); frames.commands(disable(false)); let (_, [reader, beside]) = scene.frame(&mut frames); assert!(reader > 0 && beside == 0, "only the child that shows Shown runs: {reader}, {beside}"); diff --git a/crates/ui-widgets/tests/it/list.rs b/crates/ui-widgets/tests/it/list.rs index 99d1483c8..ea8bddbab 100644 --- a/crates/ui-widgets/tests/it/list.rs +++ b/crates/ui-widgets/tests/it/list.rs @@ -8,6 +8,9 @@ use egui::{Id, Vec2}; use std::cell::RefCell; use std::rc::Rc; +/// The events a list rig records. +type Events = Rc>>>; + const NAMES: [&str; 3] = ["Artboard 1", "Artboard 2", "Artboard 3"]; /// The list's id, which a rename request names. @@ -16,7 +19,7 @@ fn list_id() -> Id { } /// A list of the three rows whose rename draft is `draft`, and what it reported. -fn rig(draft: fn(&usize) -> Option) -> (Fixture, Rc>>>) { +fn rig(draft: fn(&usize) -> Option) -> (Fixture, Events) { let seen = Rc::new(RefCell::new(Vec::new())); let held = seen.clone(); let mut fixture = Fixture::new(move |ui| { @@ -215,7 +218,7 @@ fn a_click_on_a_finding_activates_it() { } /// A list of the three rows built by `row`, in `room`, and what it reported. -fn rows_rig(room: Vec2, row: fn(usize) -> ListRow<'static>) -> (Fixture, Rc>>>) { +fn rows_rig(room: Vec2, row: fn(usize) -> ListRow<'static>) -> (Fixture, Events) { let seen = Rc::new(RefCell::new(Vec::new())); let held = seen.clone(); let mut fixture = Fixture::new(move |ui| { @@ -790,7 +793,7 @@ fn a_right_click_below_the_rows_asks_for_the_lists_own_menu() { } /// A list with the edge press `edge` (none without), and what it reported. -fn edge_rig(edge: bool) -> (Fixture, Rc>>>) { +fn edge_rig(edge: bool) -> (Fixture, Events) { use craft_behavior::{Cursor, CursorIcon}; use craft_keymap::Mods; let seen = Rc::new(RefCell::new(Vec::new())); diff --git a/crates/ui-widgets/tests/it/menu/pick_focus.rs b/crates/ui-widgets/tests/it/menu/pick_focus.rs index 3ef7865af..95bcaeda7 100644 --- a/crates/ui-widgets/tests/it/menu/pick_focus.rs +++ b/crates/ui-widgets/tests/it/menu/pick_focus.rs @@ -14,6 +14,9 @@ use egui::Id; use std::cell::{Cell, RefCell}; use std::rc::Rc; +/// The fixture with the counter and the focused id the scoped trial reads back. +type ScopedRig = (Fixture, Rc>, Rc>>); + /// A menu bar with Edit (Undo, Redo) and Help (the search over Undo), then a text field holding "hello" that has /// focus and the typed run "abc". struct Rig { @@ -117,7 +120,7 @@ fn a_shortcut_pressed_on_the_focused_bar_runs_once_where_focus_was_and_gives_foc /// A bar whose Help searches the target scope's Toggle, then the Target button inside that scope; returns the count /// of Toggle runs and the button's id. -fn scoped_rig() -> (Fixture, Rc>, Rc>>) { +fn scoped_rig() -> ScopedRig { use craft_ui::contract::ShowContainer as _; use craft_ui::runtime::commands::Commands as _; let count = Rc::new(Cell::new(0)); diff --git a/crates/ui-widgets/tests/it/text/number.rs b/crates/ui-widgets/tests/it/text/number.rs index 6c4e3b549..d61ea462b 100644 --- a/crates/ui-widgets/tests/it/text/number.rs +++ b/crates/ui-widgets/tests/it/text/number.rs @@ -299,8 +299,7 @@ fn a_value_the_check_calls_an_error_commits_and_shows_invalid_with_its_message() _ => Validity::Ok, }; let shown = *held.borrow(); - let out = - Field::new("Number").show(ui, |ui, _| NumberField::new("Number", Bind::given(shown).check(&check)).id_salt("number").show(ui)).inner; + let out = Field::new("Number").show(ui, |ui, _| NumberField::new("Number", Bind::given(shown).check(check)).id_salt("number").show(ui)).inner; if let Some(out) = out { shown_id.set(out.response.id); if let Some(typed) = out.value().copied() { diff --git a/crates/update/src/self_update/helper.rs b/crates/update/src/self_update/helper.rs index ab710b3ea..3b729a555 100644 --- a/crates/update/src/self_update/helper.rs +++ b/crates/update/src/self_update/helper.rs @@ -318,7 +318,7 @@ pub(crate) fn record_failure(paths: &Paths, error: &str) { } /// The error of the last update, if it failed, once. A long error is cut short at -/// [`RECORD_LIMIT`] bytes. +/// 4096 bytes. pub fn take_failure(paths: &Paths) -> Option { let file = failure_file(paths); let error = read_record(&file);