forge
Explore
Log in

Don't you dare go Hollow

The dead imports and the arguments nothing reads

Browse files at this commit

07ee3c7a60cd25a7dc14b12c53338264358c51b4Ahmet Kaan GümüşParent: 197d1e2
  • chore
    • the dead imports and the arguments nothing reads
Show full message
🧹 chore(app): the dead imports and the arguments nothing reads

A build printed thirteen warnings and every one of them was something the
code had stopped using: four imports nobody names any more, a picture
duration the timeline is handed and never reads, and the export flag a
rewrite of the hint line left behind.

Removed rather than hushed. An unused argument is a caller handing over
something the callee has no use for, and the two bindings that were
computed and dropped read state on every frame to throw it away.

What is left of the thirteen is five dead-code warnings whose only
callers are tests -- a panel-height ladder, a volume label, the theme's
focus stroke, the palette lookup beside it -- and taking those out means
taking their tests out, which is a decision about that code and not a
warning to be tidied on the way past.
crates/app/src/render.rsmodified+0 -1
@@ -647,7 +647,6 @@ impl Render for Player {
647647 .child(self.toolbar(cx))
648648 .child(self.timeline(
649649 position,
650- duration,
651650 state,
652651 f32::from(window.viewport_size().height),
653652 cx,
crates/app/src/tests/mod.rsmodified+5 -5
@@ -14,11 +14,11 @@ use super::{
1414 EQ_CURVE_STEPS, EQ_FFT, EQ_FREQ_HIGH, EQ_FREQ_LOW, EQ_FREQ_STEP, EQ_GAIN_LIMIT, EQ_GRAPH_H,
1515 EQ_HANDLE, EQ_Q_HIGH, EQ_Q_LOW, EQ_Q_STEP, EQ_SPECTRUM_DB, EQ_TICKS, EQ_W_MAX, ESCAPE,
1616 EXPORT_FIXED_H, EXPORT_ROWS_H, EXPORT_W, Enable, EncoderSeat, FORMATS,
17- Format, HEADER_GAP, HEADER_H, HEADER_W, HIST_BINS, HIST_H, HIST_SAMPLES, HIT_MIN, FG_PRIMARY,
18- FG_SECONDARY, KEYS_ROW_H, KEYS_ROWS_H, KEYS_W, KeyRow, LABEL_H, LABEL_MIN_W, LANE_H, LANES_MAX,
19- BG_CANVAS, LIBRARY_MAX_W, LIBRARY_MIN_W, Lane, MENU_ITEMS, MENU_PAD, MENU_ROW_H,
17+ Format, HEADER_GAP, HEADER_H, HEADER_W, HIST_BINS, HIST_H, HIST_SAMPLES, HIT_MIN,
18+ KEYS_ROW_H, KEYS_ROWS_H, KEYS_W, KeyRow, LABEL_H, LABEL_MIN_W, LANE_H, LANES_MAX,
19+ LIBRARY_MAX_W, LIBRARY_MIN_W, Lane, MENU_ITEMS, MENU_PAD, MENU_ROW_H,
2020 MBPS_DIGITS, MBPS_MAX, MBPS_MIN, MB_FLOOR, MENU_W, NO_FILE, NumberEdit, PANEL_H, ROW_ITEMS, RowCtx, RowItem,
21- Quality, ROW_H, RULER_HIT_H, BG_SELECTED, SCROLL_NOTCH_SHARE, SILENCE_ROWS,
21+ Quality, ROW_H, RULER_HIT_H, SCROLL_NOTCH_SHARE, SILENCE_ROWS,
2222 SOURCE_TINTS, SPEED_PRESETS, SPEED_STEP, BG_RAISED, SWATCH_W, Source, Speed, StreamInfo,
2323 Transport, VOLUME_W, Volume, WAVE_BPS, WAVE_COL, WAVE_COLS_MAX, Wave, band_label,
2424 bitrate_detail, bitrate_refusal, can_add, cancels_export, clipboard_after_remove, color_snap, commit_mbps,
@@ -54,7 +54,7 @@ use super::{
5454 };
5555
5656 use super::{
57- SUB_BOTTOM, SUB_CUE_MIN_W, SUB_HEAD_H, SUB_FG, SUB_LINE_H, SUB_ROWS_H,
57+ SUB_BOTTOM, SUB_CUE_MIN_W, SUB_HEAD_H, SUB_LINE_H, SUB_ROWS_H,
5858 SUB_STEM_SHARE, SUB_TEXT, clip_middle, cue_box, sub_bottom,
5959 carries_subtitles, cues_at, file_tint, is_subtitle, lang_human, row_text_w, sub_headers_fit,
6060 Subs, subtitle_detail, subtitle_notice, subtitle_tail,
crates/app/src/ui/preview.rsmodified+0 -1
@@ -1,7 +1,6 @@
11 //! The picture: what is drawn over it and what is read off it.
22
33 use crate::*;
4-use crate::ui::widgets::*;
54
65 impl Player {
76 /// The cues the *subtitle lanes* put on screen at `at`, over the picture and
crates/app/src/ui/timeline.rsmodified+0 -5
@@ -12,7 +12,6 @@ impl Player {
1212 pub(crate) fn timeline(
1313 &self,
1414 position: f64,
15- duration: f64,
1615 state: Transport,
1716 viewport_h: f32,
1817 cx: &mut Context<Self>,
@@ -23,10 +22,6 @@ impl Player {
2322 // the bed for long.
2423 let bed_w = f32::from(self.ruler.get().size.width);
2524 let filled = self.scale.px_at(position).clamp(0., bed_w);
26- // An export owns the hint slot and the ruler while it runs: the
27- // percentage and the accent bar are the same number, so the playhead
28- // fill doubles as the progress bar for free.
29- let exporting = self.exporting().is_some();
3025 let key = |action| self.keymap.display(action);
3126 // The lanes the project has, or the pair a fresh one starts with so the
3227 // panel reads the same before a file is open as after.