forge
Explore
Log in

Don't you dare go Hollow

Items nothing calls are gone or sit with the tests

Browse files at this commit

0ec584da27808305abc12251d27b4e7a254497acAhmet Kaan GümüşParent: 1361b3c
  • chore
    • items nothing calls are gone or sit with the tests
Show full message
🧹 chore(app): items nothing calls are gone or sit with the tests

`cargo build` was warning about five items in the app and two in the
vendored `rusty_h264-common`. Each is sited where its callers actually
are rather than silenced:

- `PANEL_H`, `panel_h`, `Volume::label` and `PaletteId::palette` are
  asked for only by the guards, so they are `#[cfg(test)]` now.
- `STROKE_FOCUS` is deleted: the keyboard ring it was drawn for was
  never painted, in any palette, since the token landed -- nothing in
  the editor takes gpui focus. The twelve values are in the history for
  whoever wires a focus ring.
- vendored `bs_tile` is called only by that crate's own tile guards, and
  `qpel_compose` only from `#[cfg(accel)]` blocks; both carry their call
  sites' cfg now, marked as edith patches like the manifest's.

No behaviour change. `cargo test -p edith`: 142 passed.
crates/app/src/layout.rsmodified+6 -3
@@ -12,7 +12,9 @@ pub(crate) const GHOST_MIN: f32 = 2.;
1212 pub(crate) const HEADER_H: f32 = 32.;
1313 // 28 button row + 24 scrub strip + two 48 lanes + the timecode line + the gaps
1414 // between them, with a few px of slack so a taller text line cannot push a lane
15-// off the bottom.
15+// off the bottom. The window measures itself from [`timeline_h`] now, so this
16+// figure is the guards' anchor for it and sits with them.
17+#[cfg(test)]
1618 pub(crate) const PANEL_H: f32 = 220.;
1719 /// How many lane rows are drawn before the lane column starts scrolling: past
1820 /// this the panel would be taller than the picture it belongs under, and a
@@ -230,14 +232,15 @@ pub(crate) fn px_below(max_offset_h: f32, offset_y: f32) -> f32 {
230232 /// How tall the panel is with `lanes` tracks in it: [`PANEL_H`] is sized for the
231233 /// two a project starts with, and every further one adds its own row -- up to
232234 /// [`LANES_MAX`], past which the lane column scrolls instead and the panel stops
233-/// growing.
235+/// growing. Only the guards ask, so it sits with them.
236+#[cfg(test)]
234237 pub(crate) fn panel_h(lanes: usize) -> f32 {
235238 PANEL_H + lanes_h(lanes.clamp(2, LANES_MAX)) - lanes_h(2)
236239 }
237240
238241 /// How tall the timeline region is: its own padding, the timecode line, the
239242 /// ruler and the gaps between them, plus a row per lane. Measured from its
240-/// parts rather than taken off [`PANEL_H`] -- the button row moved out of it
243+/// parts rather than taken off `PANEL_H` -- the button row moved out of it
241244 /// ([`Player::toolbar`]), and a height still carrying that row's pixels is a
242245 /// height that cuts the last lane off the bottom of the window.
243246 pub(crate) fn timeline_h(lanes: usize) -> f32 {
crates/app/src/transport.rsmodified+4 -2
@@ -81,8 +81,10 @@ impl Volume {
8181 u32::from(self.steps) * 100 / u32::from(Self::MAX_STEPS)
8282 }
8383
84- /// What the button reads. The level shows while muted too: it is what the
85- /// next press of the mute key brings back.
84+ /// What the button read before the mute state became a glyph and a colour
85+ /// ([`Player::toolbar`]): the guards still hold the wording to it, so it
86+ /// sits with them rather than in the binary.
87+ #[cfg(test)]
8688 pub(crate) fn label(self) -> String {
8789 let percent = u32::from(self.steps) * 100 / u32::from(Self::MAX_STEPS);
8890 if self.muted {
crates/app/src/ui/theme.rsmodified+7 -27
@@ -99,7 +99,6 @@ palette! {
9999 SCRIM: u32,
100100 SCRIM_LIGHT: u32,
101101 STROKE_DIVIDER: u32,
102- STROKE_FOCUS: u32,
103102 STROKE_SELECTED: u32,
104103 FG_PRIMARY: u32,
105104 FG_SECONDARY: u32,
@@ -229,7 +228,9 @@ impl PaletteId {
229228 }
230229
231230 /// The numbers themselves, for anything that has to measure a family that
232- /// is not the one in force -- which is what the contrast guards do.
231+ /// is not the one in force -- which is only the contrast guards, so it sits
232+ /// with them rather than in the binary.
233+ #[cfg(test)]
233234 pub fn palette(self) -> &'static Palette {
234235 &PALETTES[self as usize]
235236 }
@@ -320,9 +321,6 @@ pub mod cool {
320321
321322 // -- strokes ----------------------------------------------------------------
322323 pub const STROKE_DIVIDER: u32 = 0x2a3442;
323- /// The keyboard's own ring, distinct from selection on purpose: focus is
324- /// where the next stroke lands, selection is what an edit acts on.
325- pub const STROKE_FOCUS: u32 = 0xffd166;
326324 pub const STROKE_SELECTED: u32 = 0x22d3ee;
327325
328326 // -- text -------------------------------------------------------------------
@@ -395,7 +393,6 @@ pub mod warm {
395393
396394 // -- strokes ----------------------------------------------------------------
397395 pub const STROKE_DIVIDER: u32 = 0x3a322e;
398- pub const STROKE_FOCUS: u32 = 0xffc38a;
399396 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
400397
401398 // -- text -------------------------------------------------------------------
@@ -461,7 +458,6 @@ pub mod forest {
461458
462459 // -- strokes ----------------------------------------------------------------
463460 pub const STROKE_DIVIDER: u32 = 0x25362c;
464- pub const STROKE_FOCUS: u32 = 0xffd166;
465461 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
466462
467463 // -- text -------------------------------------------------------------------
@@ -526,7 +522,6 @@ pub mod violet {
526522
527523 // -- strokes ----------------------------------------------------------------
528524 pub const STROKE_DIVIDER: u32 = 0x2e3150;
529- pub const STROKE_FOCUS: u32 = 0xfde68a;
530525 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
531526
532527 // -- text -------------------------------------------------------------------
@@ -586,7 +581,6 @@ pub mod rose {
586581
587582 // -- strokes ----------------------------------------------------------------
588583 pub const STROKE_DIVIDER: u32 = 0x332f33;
589- pub const STROKE_FOCUS: u32 = 0xfcd34d;
590584 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
591585
592586 // -- text -------------------------------------------------------------------
@@ -631,8 +625,7 @@ pub mod rose {
631625 }
632626
633627 /// Family F: a graphite ground -- neutral, a touch warm -- under one gold
634-/// accent. The focus ring turns sky here: gold is the accent now, and the
635-/// keyboard's ring is the one thing that may never be mistaken for it.
628+/// accent.
636629 pub mod amber {
637630 // -- surfaces ---------------------------------------------------------------
638631 pub const BG_CANVAS: u32 = 0x0d0d0c;
@@ -649,7 +642,6 @@ pub mod amber {
649642
650643 // -- strokes ----------------------------------------------------------------
651644 pub const STROKE_DIVIDER: u32 = 0x35352f;
652- pub const STROKE_FOCUS: u32 = 0x7dd3fc;
653645 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
654646
655647 // -- text -------------------------------------------------------------------
@@ -709,9 +701,6 @@ pub mod ocean {
709701
710702 // -- strokes ----------------------------------------------------------------
711703 pub const STROKE_DIVIDER: u32 = 0x1e2d42;
712- /// Gold, not azure: on a blue ground the accent is the one hue the chrome is
713- /// full of, and a focus ring wearing it says nothing.
714- pub const STROKE_FOCUS: u32 = 0xffd166;
715704 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
716705
717706 // -- text -------------------------------------------------------------------
@@ -772,7 +761,6 @@ pub mod ice {
772761
773762 // -- strokes ----------------------------------------------------------------
774763 pub const STROKE_DIVIDER: u32 = 0x223140;
775- pub const STROKE_FOCUS: u32 = 0xfcd34d;
776764 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
777765
778766 // -- text -------------------------------------------------------------------
@@ -831,9 +819,6 @@ pub mod orchid {
831819
832820 // -- strokes ----------------------------------------------------------------
833821 pub const STROKE_DIVIDER: u32 = 0x33203f;
834- /// Sky: the ring is neither the orchid the window is full of nor the gold
835- /// the playhead is, so all three are told apart at a glance.
836- pub const STROKE_FOCUS: u32 = 0x7dd3fc;
837822 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
838823
839824 // -- text -------------------------------------------------------------------
@@ -901,9 +886,6 @@ pub mod nord {
901886
902887 // -- strokes ----------------------------------------------------------------
903888 pub const STROKE_DIVIDER: u32 = 0x434c5e;
904- /// `nord12`. The Frost blue is the accent here, so the ring is Aurora's
905- /// orange -- and the playhead is the yellow beside it, never this.
906- pub const STROKE_FOCUS: u32 = 0xd08770;
907889 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
908890
909891 // -- text -------------------------------------------------------------------
@@ -955,9 +937,9 @@ pub mod nord {
955937 /// and `bg2` are the surfaces verbatim and `fg1`..`fg4` the ink; the clip bodies
956938 /// are the neutral-mode hues taken down for the same reason Nord's are.
957939 ///
958-/// Three of its colours do three jobs here rather than one: orange is the
959-/// accent, green the playhead, blue the focus ring -- so the family is
960-/// recognisable from the chrome and not only from the ground.
940+/// Two of its colours do two jobs here rather than one: orange is the accent
941+/// and green the playhead -- so the family is recognisable from the chrome and
942+/// not only from the ground.
961943 pub mod gruvbox {
962944 // -- surfaces ---------------------------------------------------------------
963945 pub const BG_CANVAS: u32 = 0x1d2021;
@@ -974,7 +956,6 @@ pub mod gruvbox {
974956
975957 // -- strokes ----------------------------------------------------------------
976958 pub const STROKE_DIVIDER: u32 = 0x504945;
977- pub const STROKE_FOCUS: u32 = 0x83a598;
978959 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
979960
980961 // -- text -------------------------------------------------------------------
@@ -1036,7 +1017,6 @@ pub mod dracula {
10361017
10371018 // -- strokes ----------------------------------------------------------------
10381019 pub const STROKE_DIVIDER: u32 = 0x44475a;
1039- pub const STROKE_FOCUS: u32 = 0x8be9fd;
10401020 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
10411021
10421022 // -- text -------------------------------------------------------------------
vendor/rusty_h264-common/src/deblock.rsmodified+3 -0
@@ -330,6 +330,9 @@ fn bs1_tile(p: &Blk, q: &Blk) -> bool {
330330 /// Boundary strength from tile entries (spec §8.7.2.1).
331331 /// Branchless for the same reason as [`BlockInfo::bs_branchless`], but now with
332332 /// every operand already in a register rather than behind a strided load.
333+// --- edith patch: only the `#[cfg(test)]` tile guards below call this, so it
334+// sits with them rather than warning in every build. ---
335+#[cfg(test)]
333336 #[inline]
334337 fn bs_tile(p: &Blk, q: &Blk, mb_edge: bool) -> i32 {
335338 let intra = !(p.inter & q.inter);
vendor/rusty_h264-common/src/inter.rsmodified+2 -0
@@ -510,6 +510,8 @@ fn avg_full(t: &[u8], ts: usize, bw: usize, bh: usize, dr: usize, dc: usize, hal
510510 }
511511
512512 /// A/B: restore half→scratch→avg compose for one-filter qpel (`RS_H264_QPEL_COMPOSE=1`).
513+// --- edith patch: both call sites are `#[cfg(accel)]`, so the switch is too. ---
514+#[cfg(accel)]
513515 #[inline]
514516 fn qpel_compose() -> bool {
515517 use std::sync::OnceLock;