forge
Explore
Log in

Don't you dare go Hollow

Cargo fmt pass over the media-kind verb-filtering diff

Browse files at this commit

9ac15de269df550b8293e3bbb64f249fd5d4abeaAhmet Kaan GümüşParent: 726f956
  • style
    • cargo fmt pass over the media-kind verb-filtering diff
Show full message
🎨 style(app): cargo fmt pass over the media-kind verb-filtering diff

No behavior change -- just rustfmt normalizing line wraps the prior
commit left ragged.
crates/app/src/interact.rsmodified+0 -1
@@ -335,4 +335,3 @@ pub(crate) fn repeats(scope: Repeat, key: &str, action: Option<ActionId>) -> boo
335335 Repeat::Nothing => false,
336336 }
337337 }
338-
crates/app/src/player/library.rsmodified+2 -1
@@ -626,7 +626,8 @@ impl Player {
626626 // still being walked ([`Player::toggle_proxy`]'s `Asked` arm) sets it,
627627 // so the walk unwinds mid-read instead of running to completion.
628628 let cancel = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false));
629- self.proxies.insert(path.clone(), Proxy::Asked(cancel.clone()));
629+ self.proxies
630+ .insert(path.clone(), Proxy::Asked(cancel.clone()));
630631 let started = cx.background_executor().spawn({
631632 let path = path.clone();
632633 async move { engine::proxy::generate_if_wanted(&path, &cancel) }
crates/app/src/player/timeline_edit.rsmodified+7 -1
@@ -1658,7 +1658,13 @@ impl Player {
16581658 /// [`Project::crossfade`]), so a step past the successor's own length
16591659 /// lands at the successor's length instead of asking for more than
16601660 /// there is.
1661- pub(crate) fn nudge_transition(&mut self, lane: Lane, idx: usize, step: i32, cx: &mut Context<Self>) {
1661+ pub(crate) fn nudge_transition(
1662+ &mut self,
1663+ lane: Lane,
1664+ idx: usize,
1665+ step: i32,
1666+ cx: &mut Context<Self>,
1667+ ) {
16621668 let Some(session) = &mut self.session else {
16631669 return;
16641670 };
crates/app/src/player/transport.rsmodified+1 -2
@@ -54,8 +54,7 @@ impl Player {
5454 // a frame counter this pump keeps -- the same `now()`
5555 // [`Player::step`] reads.
5656 let loop_window = active_loop_window(self.loop_on, self.range, self.loop_trim);
57- if session.is_playing() && should_loop_restart(frame_at(session.now(), fps), loop_window)
58- {
57+ if session.is_playing() && should_loop_restart(frame_at(session.now(), fps), loop_window) {
5958 let start = loop_window.map_or(0, |(lo, _)| lo);
6059 session.seek(f64::from(start) / fps);
6160 }
crates/app/src/subs.rsmodified+6 -1
@@ -259,7 +259,12 @@ pub(crate) fn audio_import_tail(path: &std::path::Path, has_video: bool) -> Stri
259259 let secs = engine::AudioSession::duration_secs(path).ok().flatten();
260260 match (probe, secs) {
261261 (Some(p), Some(secs)) => {
262- format!(" — {} Hz, {} ch, {}s", p.sample_rate, p.channels, secs.round() as u64)
262+ format!(
263+ " — {} Hz, {} ch, {}s",
264+ p.sample_rate,
265+ p.channels,
266+ secs.round() as u64
267+ )
263268 }
264269 _ => String::new(),
265270 }
crates/app/src/tests/cards.rsmodified+23 -7
@@ -1028,7 +1028,12 @@ fn a_typed_bitrate_is_a_field_and_not_a_key_capture() {
10281028 let mut edit = mbps_edit(0);
10291029 edit.digit(0);
10301030 assert_eq!(edit.commit(), None);
1031- assert!(edit.refusal.clone().expect("zero says why").contains("0 is not a value"));
1031+ assert!(
1032+ edit.refusal
1033+ .clone()
1034+ .expect("zero says why")
1035+ .contains("0 is not a value")
1036+ );
10321037 assert_eq!(mbps_edit(MBPS_MIN).commit(), Some(MBPS_MIN));
10331038 assert_eq!(mbps_edit(MBPS_MAX).commit(), Some(MBPS_MAX));
10341039 let mut edit = mbps_edit(0);
@@ -1143,7 +1148,10 @@ fn a_duration_row_shows_only_for_a_transition_and_its_room_is_the_successors() {
11431148 // A plain cut carries neither field, so the row has nothing to show.
11441149 let plain = clip(0, 10, 0, 0, 0);
11451150 let plain_next = clip(10, 15, 0, 0, 0);
1146- assert_eq!(transition_of(LaneKind::Video, &plain, Some(&plain_next)), None);
1151+ assert_eq!(
1152+ transition_of(LaneKind::Video, &plain, Some(&plain_next)),
1153+ None
1154+ );
11471155
11481156 // A dissolve: video lane, `transition_out` set, an adjacent successor.
11491157 // The room offered is the shorter of the two -- here the successor's own
@@ -1506,11 +1514,16 @@ fn the_export_card_fits_the_smallest_window() {
15061514 (17. + 28. + 15. + 30. + CONTROL_H + 4. + 10. + 24.),
15071515 title + status + summary + CONTROL_H + 4. + gaps + padding
15081516 );
1509- assert!((17. + 28. + 15. + 30. + CONTROL_H + 4. + 10. + 24.) + (8. * KEYS_ROW_H) <= 360., "card too tall");
1517+ assert!(
1518+ (17. + 28. + 15. + 30. + CONTROL_H + 4. + 10. + 24.) + (8. * KEYS_ROW_H) <= 360.,
1519+ "card too tall"
1520+ );
15101521 // The list grows with a window that has the room -- and never shrinks
15111522 // below the cap that made the floor fit, whatever arithmetic the window
15121523 // hands it.
1513- let cap = |h: f32| (h - (17. + 28. + 15. + 30. + CONTROL_H + 4. + 10. + 24.) - 24.).max(8. * KEYS_ROW_H);
1524+ let cap = |h: f32| {
1525+ (h - (17. + 28. + 15. + 30. + CONTROL_H + 4. + 10. + 24.) - 24.).max(8. * KEYS_ROW_H)
1526+ };
15141527 assert_eq!(cap(360.), (8. * KEYS_ROW_H));
15151528 assert_eq!(cap(0.), (8. * KEYS_ROW_H));
15161529 assert!(cap(720.) > (8. * KEYS_ROW_H));
@@ -2096,14 +2109,17 @@ fn darkroom_source_rows_keep_proxy_add_and_media_audio_text_paths() {
20962109 #[test]
20972110 fn toggle_proxy_wakes_the_asked_phase_it_stops() {
20982111 let library = src_text("player/library.rs");
2099- let start = &library[library.find("fn start_proxy_for(").expect("start_proxy_for")..];
2112+ let start = &library[library
2113+ .find("fn start_proxy_for(")
2114+ .expect("start_proxy_for")..];
21002115 assert!(
21012116 start.contains("generate_if_wanted(&path, &cancel)"),
21022117 "start_proxy_for no longer hands the header read a cancel flag anyone can reach"
21032118 );
21042119 let toggle = &library[library.find("fn toggle_proxy(").expect("toggle_proxy")..];
2105- let asked_arm =
2106- &toggle[toggle.find("Proxy::Asked(cancel)").expect("the Asked arm's own flag")..];
2120+ let asked_arm = &toggle[toggle
2121+ .find("Proxy::Asked(cancel)")
2122+ .expect("the Asked arm's own flag")..];
21072123 assert!(
21082124 asked_arm.contains("cancel.store(true"),
21092125 "a stop asked during Asked no longer sets the flag the header read polls"
crates/app/src/tests/layout.rsmodified+6 -2
@@ -272,11 +272,15 @@ fn a_stateful_button_keeps_its_rect() {
272272 // `armed` (whether cancel is armed), and neither may gate its own
273273 // button out of the tree.
274274 let cards = src_text("ui/cards.rs");
275- for (id, flag) in [("\"eq-spectrum\"", "self.eq_spectrum"), ("\"export-cancel\"", "armed")] {
275+ for (id, flag) in [
276+ ("\"eq-spectrum\"", "self.eq_spectrum"),
277+ ("\"export-cancel\"", "armed"),
278+ ] {
276279 let at = cards.find(id).unwrap_or_else(|| panic!("no {id} button"));
277280 let before = &cards[at.saturating_sub(350)..at];
278281 assert!(
279- !before.contains(&format!(".when({flag}")) && !before.contains(&format!(".when(!{flag}")),
282+ !before.contains(&format!(".when({flag}"))
283+ && !before.contains(&format!(".when(!{flag}")),
280284 "{id} is gated on the very flag it flips -- its rect would move when the state does"
281285 );
282286 }
crates/app/src/tests/mod.rsmodified+10 -10
@@ -22,16 +22,16 @@ use super::{
2222 SPEED_PRESETS, SPEED_STEP, STATUS_ERROR, STATUS_SUCCESS, STATUS_WARNING, SUB_PLAN_CHARS,
2323 Source, Speed, StreamInfo, TIMELINE_SHARE, Transport, VOLUME_W, Volume, WAVE_BPS, WAVE_COL,
2424 WAVE_COLS_MAX, Wave, ZOOM_MIN_FRAMES, active_lane, band_label, bitrate_detail, bitrate_refusal,
25- clipboard_after_remove, color_snap, containers, enable, enable_lane, envelope,
26- eq_card_w, eq_freq, eq_freq_label, eq_graph_h, eq_spectrum, eq_x, eq_y, estimated_bytes,
27- export_path, export_settings, format_line, format_refusal, fps_choices, fps_label, frac_along,
28- frac_down, frame_at, frame_rate_ladder, histogram, inserted_band, is_project, keymap,
29- keys_rows, lanes_h, marked, menu_at, menu_items, menu_rows_h, next_container, normalise,
30- nothing_to_play, notice_tone, panel_h, project_path, proxies_to_start, push_notice, px_below,
31- retarget, row_enable, row_items, scrub_due, secs_label, should_resync, silence_rate,
32- size_label, snap_cue, snap_marks, snapped, source_tint, span_partner, speed_at,
33- sub_pick_after_removal, subtitle_plan, summary_head, summary_tail, timecode, timeline_fixed_h,
34- tip_may_paint, transport, typed, unseen_paths, unseen_sources, whole_take, window_title,
25+ clipboard_after_remove, color_snap, containers, enable, enable_lane, envelope, eq_card_w,
26+ eq_freq, eq_freq_label, eq_graph_h, eq_spectrum, eq_x, eq_y, estimated_bytes, export_path,
27+ export_settings, format_line, format_refusal, fps_choices, fps_label, frac_along, frac_down,
28+ frame_at, frame_rate_ladder, histogram, inserted_band, is_project, keymap, keys_rows, lanes_h,
29+ marked, menu_at, menu_items, menu_rows_h, next_container, normalise, nothing_to_play,
30+ notice_tone, panel_h, project_path, proxies_to_start, push_notice, px_below, retarget,
31+ row_enable, row_items, scrub_due, secs_label, should_resync, silence_rate, size_label,
32+ snap_cue, snap_marks, snapped, source_tint, span_partner, speed_at, sub_pick_after_removal,
33+ subtitle_plan, summary_head, summary_tail, timecode, timeline_fixed_h, tip_may_paint,
34+ transport, typed, unseen_paths, unseen_sources, whole_take, window_title,
3535 };
3636
3737 use super::{
crates/app/src/tests/view.rsmodified+7 -4
@@ -136,8 +136,7 @@ fn a_lane_refuses_the_files_it_cannot_hold_before_the_release_says_so() {
136136 // ...and a subtitle lane holds none of the three: a caption comes off the
137137 // Subtitles list, which is where the refusal points.
138138 for (file, has_video) in [(sound, false), (still, true), (movie, true)] {
139- let why =
140- lane_refuses(file, Lane::S1, has_video).expect("a subtitle lane takes no media");
139+ let why = lane_refuses(file, Lane::S1, has_video).expect("a subtitle lane takes no media");
141140 assert!(why.starts_with("NOT ON S1 — "), "{why}");
142141 assert!(why.contains("Subtitles list"), "{why}");
143142 }
@@ -937,7 +936,9 @@ fn only_tab_is_intercepted_by_a_focused_surface_everything_else_reaches_root() {
937936 use crate::ui::stance::is_focus_cycle_key;
938937
939938 assert!(is_focus_cycle_key("tab"));
940- for key in ["space", "escape", "s", "c", "left", "right", "enter", "delete", "?"] {
939+ for key in [
940+ "space", "escape", "s", "c", "left", "right", "enter", "delete", "?",
941+ ] {
941942 assert!(!is_focus_cycle_key(key), "{key} must bubble to the root");
942943 }
943944 }
@@ -952,7 +953,9 @@ fn escape_is_the_only_key_a_focused_surface_uses_to_leave_the_ring() {
952953 use crate::ui::stance::is_focus_exit_key;
953954
954955 assert!(is_focus_exit_key("escape"));
955- for key in ["tab", "space", "s", "c", "left", "right", "enter", "delete", "?"] {
956+ for key in [
957+ "tab", "space", "s", "c", "left", "right", "enter", "delete", "?",
958+ ] {
956959 assert!(!is_focus_exit_key(key), "{key} must not exit the ring");
957960 }
958961 }
crates/app/src/timeline_math.rsmodified+0 -1
@@ -427,7 +427,6 @@ pub(crate) fn sub_mark(subs: &[SubClip], start: u32) -> Option<usize> {
427427 subs.iter().position(|s| s.start == start)
428428 }
429429
430-
431430 /// Scales an envelope to its own loudest sample, so a quietly mastered source
432431 /// still draws as a shape. The fixtures peak around an eighth of full scale, and
433432 /// an eighth of a 30 px lane is a flat line -- which says "silent" about a file
crates/app/src/ui/bench_stance.rsmodified+16 -4
@@ -1048,7 +1048,10 @@ fn lane_row(
10481048 )
10491049 .drag_over::<AssetDrag>(|d, _, _, _| d.bg(rgb(DARK_RAISED())))
10501050 .on_drop(cx.listener(move |this, drag: &AssetDrag, window, cx| {
1051- let x = this.drag_x.take().unwrap_or_else(|| window.mouse_position().x);
1051+ let x = this
1052+ .drag_x
1053+ .take()
1054+ .unwrap_or_else(|| window.mouse_position().x);
10521055 let at = this.place_frame(x).0;
10531056 this.insert_source(&drag.0.clone(), drag.1, Some(lane), Some(at), cx)
10541057 }))
@@ -1090,7 +1093,10 @@ fn lane_row(
10901093 let Some(idx) = this.dragged(drag) else {
10911094 return;
10921095 };
1093- let x = this.drag_x.take().unwrap_or_else(|| window.mouse_position().x);
1096+ let x = this
1097+ .drag_x
1098+ .take()
1099+ .unwrap_or_else(|| window.mouse_position().x);
10941100 this.move_clip(drag.lane, idx, lane, x, cx)
10951101 }))
10961102 .on_drag_move(
@@ -1108,7 +1114,10 @@ fn lane_row(
11081114 // the same call `ui/timeline.rs`'s own bed makes).
11091115 .drag_over::<SubDrag>(|d, _, _, _| d.bg(rgb(DARK_RAISED())))
11101116 .on_drop(cx.listener(move |this, drag: &SubDrag, window, cx| {
1111- let x = this.drag_x.take().unwrap_or_else(|| window.mouse_position().x);
1117+ let x = this
1118+ .drag_x
1119+ .take()
1120+ .unwrap_or_else(|| window.mouse_position().x);
11121121 this.move_sub(drag, lane, x, cx);
11131122 }))
11141123 .on_drag_move(
@@ -1123,7 +1132,10 @@ fn lane_row(
11231132 )
11241133 .drag_over::<SubPick>(|d, _, _, _| d.bg(rgb(DARK_RAISED())))
11251134 .on_drop(cx.listener(move |this, drag: &SubPick, window, cx| {
1126- let x = this.drag_x.take().unwrap_or_else(|| window.mouse_position().x);
1135+ let x = this
1136+ .drag_x
1137+ .take()
1138+ .unwrap_or_else(|| window.mouse_position().x);
11271139 this.place_sub(drag.0, lane, x, cx);
11281140 }))
11291141 .on_drag_move(
crates/app/src/ui/stance.rsmodified+6 -4
@@ -42,7 +42,11 @@ const SURFACE_CYCLE: [Surface; 3] = [Surface::Dock, Surface::Bench, Surface::Ins
4242 pub(crate) fn next_surface(current: Surface, backward: bool) -> Surface {
4343 let i = SURFACE_CYCLE.iter().position(|&s| s == current).unwrap();
4444 let n = SURFACE_CYCLE.len();
45- SURFACE_CYCLE[if backward { (i + n - 1) % n } else { (i + 1) % n }]
45+ SURFACE_CYCLE[if backward {
46+ (i + n - 1) % n
47+ } else {
48+ (i + 1) % n
49+ }]
4650 }
4751
4852 /// The one key a surface's own `on_key_down` answers. Everything else is
@@ -396,9 +400,7 @@ fn ghost(
396400 .rounded(px(3.))
397401 .cursor_pointer()
398402 .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1())))
399- .on_click(cx.listener(move |this, _: &ClickEvent, window, cx| {
400- this.act(action, window, cx)
401- }))
403+ .on_click(cx.listener(move |this, _: &ClickEvent, window, cx| this.act(action, window, cx)))
402404 .type_style(type_scale::label(
403405 type_scale::LABEL_ROW_PX,
404406 gpui::FontWeight::MEDIUM,
crates/app/src/ui/widgets.rsmodified+8 -2
@@ -315,7 +315,10 @@ impl NumberEdit {
315315 /// past.
316316 pub(crate) fn digit(&mut self, digit: u32) {
317317 if self.text.chars().count() >= self.digits {
318- self.refusal = Some(format!("{} digits is already past the ceiling", self.digits));
318+ self.refusal = Some(format!(
319+ "{} digits is already past the ceiling",
320+ self.digits
321+ ));
319322 return;
320323 }
321324 match char::from_digit(digit, 10) {
@@ -370,7 +373,10 @@ impl NumberEdit {
370373 None
371374 }
372375 Ok(v) => {
373- self.refusal = Some(format!("{v} is past the {} {} ceiling", self.max, self.unit));
376+ self.refusal = Some(format!(
377+ "{v} is past the {} {} ceiling",
378+ self.max, self.unit
379+ ));
374380 None
375381 }
376382 Err(_) => {
crates/app/src/viewport.rsmodified+0 -1
@@ -2,7 +2,6 @@
22
33 use crate::*;
44
5-
65 /// A span of seconds as a person reads it: one decimal above a second, two
76 /// below -- [`scaled`]'s rule, for its reason. The tightest zoom is
87 /// [`ZOOM_MIN_FRAMES`] across the bed, which on the 240 fps slow-motion a phone