diff --git a/crates/engine/src/cmd/layout/tests.rs b/crates/engine/src/cmd/layout/tests.rs index 666c54b37..03356b892 100644 --- a/crates/engine/src/cmd/layout/tests.rs +++ b/crates/engine/src/cmd/layout/tests.rs @@ -158,12 +158,9 @@ fn viewport_scale_lock_and_layers() { // Layer 0 frozen in the viewport: nothing of the model shows. let list = cadcraft_render::build(s.doc().unwrap(), &Space::Paper("Layout1".into()), &cadcraft_render::Options::default()); assert!(list.prims.iter().all(|p| p.handle != cadcraft_render::VIEWPORT_CONTENT)); - for bad_p in [ - json!({"handle": h, "scale": "0:0"}), - json!({"handle": h, "scale": -1}), - json!({"handle": h, "viewHeight": 0}), - json!({"handle": "FFFFFF"}), - ] { + for bad_p in + [json!({"handle": h, "scale": "0:0"}), json!({"handle": h, "scale": -1}), json!({"handle": h, "viewHeight": 0}), json!({"handle": "FFFFFF"})] + { assert!(s.execute("viewport.set", &bad_p).is_err(), "{bad_p}"); } } diff --git a/crates/geom/src/spline/tests.rs b/crates/geom/src/spline/tests.rs index 563f84760..d953cfabd 100644 --- a/crates/geom/src/spline/tests.rs +++ b/crates/geom/src/spline/tests.rs @@ -73,12 +73,7 @@ fn stack_basis_matches_the_heap_basis_bit_for_bit() { let t = lo + (hi - lo) * i as f64 / 1000.0; let got = s.eval(t); let want = eval_ref(&s, t); - assert_eq!( - (got.x.to_bits(), got.y.to_bits()), - (want.x.to_bits(), want.y.to_bits()), - "degree {} at {t}: {got:?} vs {want:?}", - s.degree - ); + assert_eq!((got.x.to_bits(), got.y.to_bits()), (want.x.to_bits(), want.y.to_bits()), "degree {} at {t}: {got:?} vs {want:?}", s.degree); let span = find_span(s.control.len() - 1, s.degree, t.clamp(lo, hi), &s.knots); let b = basis(span, t.clamp(lo, hi), s.degree, &s.knots); let r = basis_ref(span, t.clamp(lo, hi), s.degree, &s.knots); @@ -184,10 +179,8 @@ fn bounds_keep_their_cap_over_many_spans() { assert!(b.contains(want.min) && b.contains(want.max), "{b:?} vs {want:?}"); } let diag = want.min.dist(want.max); - let err = [b.min.x - want.min.x, b.min.y - want.min.y, b.max.x - want.max.x, b.max.y - want.max.y] - .into_iter() - .map(f64::abs) - .fold(0.0, f64::max); + let err = + [b.min.x - want.min.x, b.min.y - want.min.y, b.max.x - want.max.x, b.max.y - want.max.y].into_iter().map(f64::abs).fold(0.0, f64::max); assert!(err <= 1e-3 * diag, "{n} control points: {b:?} vs {want:?}"); } } diff --git a/crates/ui-egui/src/capture/tests.rs b/crates/ui-egui/src/capture/tests.rs index ed5e85f3f..6e70aea7b 100644 --- a/crates/ui-egui/src/capture/tests.rs +++ b/crates/ui-egui/src/capture/tests.rs @@ -15,14 +15,7 @@ fn app() -> CadApp { /// A visible, focused, 1-ppp surface of `size` with an 8192-pixel texture side. fn surface(size: egui::Vec2) -> SurfaceGeometry { - SurfaceGeometry { - viewport: Some(size), - pixels_per_point: 1.0, - max_texture_side: 8192, - minimized: false, - occluded: false, - window_focused: true, - } + SurfaceGeometry { viewport: Some(size), pixels_per_point: 1.0, max_texture_side: 8192, minimized: false, occluded: false, window_focused: true } } /// Seed the admission snapshot a raw hook would have taken, then bump both epochs as an diff --git a/crates/ui-egui/src/hatchdlg/tests.rs b/crates/ui-egui/src/hatchdlg/tests.rs index b2c9a4b56..249c49812 100644 --- a/crates/ui-egui/src/hatchdlg/tests.rs +++ b/crates/ui-egui/src/hatchdlg/tests.rs @@ -234,8 +234,7 @@ fn picks_merge_into_the_state() { fn frames(app: &mut CadApp) -> egui::Context { let ctx = egui::Context::default(); app.logic(&ctx); - let input = - egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1600.0, 1000.0))), ..Default::default() }; + let input = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1600.0, 1000.0))), ..Default::default() }; // Enough frames for a window that grows each frame to show it. for _ in 0..30 { let mut output = ctx.run_ui(input.clone(), |ui| app.ui(ui)); @@ -375,10 +374,8 @@ fn hatchedit_opens_edit_mode_on_the_selection_or_asks_for_a_hatch() { #[test] fn edit_mode_on_an_out_of_range_hatch_changes_nothing_by_itself() { let (mut app, _) = app_with_rect(); - let hx = app.session.execute("hatch", &json!({ "points": [[5, 5]], "scale": 5.0e6, "angle": 400 })).unwrap()["handle"] - .as_str() - .unwrap() - .to_string(); + let hx = + app.session.execute("hatch", &json!({ "points": [[5, 5]], "scale": 5.0e6, "angle": 400 })).unwrap()["handle"].as_str().unwrap().to_string(); app.session.set_selection(vec![Handle::parse_hex(&hx).unwrap()]); open_edit(&mut app); frames(&mut app);