style: apply cargo fmt across workspace (as on main)

Formats the branch the way main's 9cf9ff2 did, so merging main only
conflicts where the code itself differs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013RyGiMXcsf9HTKfqDxaQGt
This commit is contained in:
Claude committed 2026-10-11 18:29:37 +00:00
1 parent cc17d10ca9
commit bf1c4ddc74
532 files changed
+56995 -33416

No files matched your search

+55 -14
View File
@@ -21,7 +21,9 @@ fn line_with_z(z0: f64, z1: f64) -> EntityType {
#[test]
fn golden_line_projects_and_resets_thickness_normal() {
let flat = flatten_entity_z(&line_with_z(3.0, 5.0)).expect("moves");
let EntityType::Line(l) = flat else { panic!("variant") };
let EntityType::Line(l) = flat else {
panic!("variant")
};
assert_eq!((l.start.z, l.end.z), (0.0, 0.0));
assert_eq!((l.start.x, l.start.y), (0.0, 0.0));
assert_eq!((l.end.x, l.end.y), (3.0, 4.0));
@@ -34,18 +36,27 @@ fn golden_tilted_circle_becomes_ellipse() {
let mut c = codec::entities::Circle::from_center_radius(Vector3::new(1.0, 2.0, 4.0), 5.0);
c.normal = Vector3::new(0.0, 0.6, 0.8);
let flat = flatten_entity_z(&EntityType::Circle(c)).expect("moves");
assert!(matches!(flat, EntityType::Ellipse(_)), "tilted circle → ellipse");
assert!(
matches!(flat, EntityType::Ellipse(_)),
"tilted circle → ellipse"
);
}
#[test]
fn golden_polyline3d_vertices_and_elevation_zeroed() {
let mut pl = Polyline3D::new();
pl.elevation = 5.0;
pl.vertices.push(Vertex3DPolyline::new(Vector3::new(1.0, 2.0, 7.5)));
pl.vertices
.push(Vertex3DPolyline::new(Vector3::new(1.0, 2.0, 7.5)));
let flat = flatten_entity_z(&EntityType::Polyline3D(pl)).expect("moves");
let EntityType::Polyline3D(pl) = flat else { panic!("variant") };
let EntityType::Polyline3D(pl) = flat else {
panic!("variant")
};
assert_eq!(pl.elevation, 0.0);
assert!(pl.vertices.iter().all(|v| v.position.z == 0.0 && v.position.x == 1.0));
assert!(pl
.vertices
.iter()
.all(|v| v.position.z == 0.0 && v.position.x == 1.0));
}
#[test]
@@ -54,7 +65,9 @@ fn golden_polyline2d_elevation_zeroed() {
pl.elevation = 9.0;
pl.vertices.push(Vertex2D::new(Vector3::new(3.0, 4.0, 0.0)));
let flat = flatten_entity_z(&EntityType::Polyline2D(pl)).expect("moves");
let EntityType::Polyline2D(pl) = flat else { panic!("variant") };
let EntityType::Polyline2D(pl) = flat else {
panic!("variant")
};
assert_eq!(pl.elevation, 0.0);
assert_eq!(pl.vertices[0].location.z, 0.0);
}
@@ -65,7 +78,9 @@ fn golden_text_insertion_and_normal_zeroed() {
t.insertion_point = Vector3::new(1.0, 2.0, 3.0);
t.thickness = 1.0;
let flat = flatten_entity_z(&EntityType::Text(t)).expect("moves");
let EntityType::Text(t) = flat else { panic!("variant") };
let EntityType::Text(t) = flat else {
panic!("variant")
};
assert_eq!(t.insertion_point.z, 0.0);
assert_eq!(t.thickness, 0.0);
assert_eq!(t.normal, Vector3::UNIT_Z);
@@ -80,9 +95,16 @@ fn golden_solid_corners_zeroed() {
Vector3::new(0.0, 1.0, 4.0),
);
let flat = flatten_entity_z(&EntityType::Solid(s)).expect("moves");
let EntityType::Solid(s) = flat else { panic!("variant") };
let EntityType::Solid(s) = flat else {
panic!("variant")
};
assert_eq!(
[s.first_corner.z, s.second_corner.z, s.third_corner.z, s.fourth_corner.z],
[
s.first_corner.z,
s.second_corner.z,
s.third_corner.z,
s.fourth_corner.z
],
[0.0; 4]
);
}
@@ -132,12 +154,28 @@ fn collect_excludes_entities_outside_active_space() {
// Enter block editor scoping on block b: entities whose owner block
// differs from the active space must be excluded.
scene.block_edit_block = Some(b);
scene.document.get_entity_mut(a).unwrap().common_mut().owner_handle = c; // wrong owner
scene.document.get_entity_mut(c).unwrap().common_mut().owner_handle = b; // active block
scene
.document
.get_entity_mut(a)
.unwrap()
.common_mut()
.owner_handle = c; // wrong owner
scene
.document
.get_entity_mut(c)
.unwrap()
.common_mut()
.owner_handle = b; // active block
let candidates = collect_flatten_handles(&scene);
assert!(!candidates.contains(&a), "wrong-owner entity must be excluded");
assert!(candidates.contains(&c), "owner of the active block must be included");
assert!(
!candidates.contains(&a),
"wrong-owner entity must be excluded"
);
assert!(
candidates.contains(&c),
"owner of the active block must be included"
);
}
#[test]
@@ -165,7 +203,10 @@ fn plan_moves_only_movable_candidates() {
assert_eq!((l.start.z, l.end.z), (0.0, 0.0));
}
// Ray untouched.
assert!(matches!(scene.document.get_entity(ray).unwrap(), EntityType::Ray(_)));
assert!(matches!(
scene.document.get_entity(ray).unwrap(),
EntityType::Ray(_)
));
}
#[test]