forked from 1b-agent/opencadstudio-upstream
style: apply cargo fmt across workspace
This commit is contained in:
1 parent
85710e5454
commit
9cf9ff2c5c
531 files changed
+57740
-33906
No files matched your search
@@ -807,10 +807,7 @@ fn remap_plane_offset(
|
||||
/// its first handle, so "some handle in `xrefs` exists" was true even for a
|
||||
/// reference whose actual source had been erased. Walking the chain asks the
|
||||
/// question that was meant — is the geometry still there.
|
||||
pub(crate) fn dimension_is_associative(
|
||||
document: &codec::CadDocument,
|
||||
dimension: Handle,
|
||||
) -> bool {
|
||||
pub(crate) fn dimension_is_associative(document: &codec::CadDocument, dimension: Handle) -> bool {
|
||||
document.objects.values().any(|object| {
|
||||
let ObjectType::Associative(object) = object else {
|
||||
return false;
|
||||
@@ -2159,9 +2156,7 @@ impl Scene {
|
||||
}
|
||||
pub(crate) fn sync_diameter_association_angle(&mut self, dimension: Handle) {
|
||||
let chord = match self.document.get_entity(dimension) {
|
||||
Some(EntityType::Dimension(Dimension::Diameter(diameter))) => {
|
||||
diameter.angle_vertex
|
||||
}
|
||||
Some(EntityType::Dimension(Dimension::Diameter(diameter))) => diameter.angle_vertex,
|
||||
_ => return,
|
||||
};
|
||||
|
||||
@@ -2253,10 +2248,7 @@ mod tests {
|
||||
5.0,
|
||||
)));
|
||||
let dimension = scene.add_entity(EntityType::Dimension(Dimension::Diameter(
|
||||
DimensionDiameter::new(
|
||||
Vector3::new(5.0, 0.0, 0.0),
|
||||
Vector3::new(-5.0, 0.0, 0.0),
|
||||
),
|
||||
DimensionDiameter::new(Vector3::new(5.0, 0.0, 0.0), Vector3::new(-5.0, 0.0, 0.0)),
|
||||
)));
|
||||
scene.attach_dimension_association(dimension, vec![Some(circle)]);
|
||||
let association = scene
|
||||
@@ -2269,7 +2261,10 @@ mod tests {
|
||||
object.data,
|
||||
AssociativeData::DimensionAssociation(ref association)
|
||||
if association.dimension == dimension
|
||||
) => Some(*handle),
|
||||
) =>
|
||||
{
|
||||
Some(*handle)
|
||||
}
|
||||
_ => None,
|
||||
})
|
||||
.expect("diameter association");
|
||||
@@ -2456,7 +2451,11 @@ pub(crate) fn drop_stray_dimension_reactors(document: &mut codec::CadDocument) -
|
||||
.iter()
|
||||
.flatten()
|
||||
.flat_map(|reference| {
|
||||
reference.xrefs.iter().chain(&reference.intersection_objects).copied()
|
||||
reference
|
||||
.xrefs
|
||||
.iter()
|
||||
.chain(&reference.intersection_objects)
|
||||
.copied()
|
||||
})
|
||||
.collect();
|
||||
Some((*handle, (association.dimension, geometry)))
|
||||
@@ -2466,7 +2465,10 @@ pub(crate) fn drop_stray_dimension_reactors(document: &mut codec::CadDocument) -
|
||||
return 0;
|
||||
}
|
||||
let mut dropped = 0;
|
||||
let handles: Vec<Handle> = document.entities().map(|entity| entity.common().handle).collect();
|
||||
let handles: Vec<Handle> = document
|
||||
.entities()
|
||||
.map(|entity| entity.common().handle)
|
||||
.collect();
|
||||
for handle in handles {
|
||||
let Some(entity) = document.get_entity_mut(handle) else {
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user