Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

rustfmt on the pin's changes

jyviko47c685d4719a
diff --git a/crates/kernel/src/body.rs b/crates/kernel/src/body.rs
index c4b7315d24..8f38f25dba 100644
--- a/crates/kernel/src/body.rs
+++ b/crates/kernel/src/body.rs
@@ -545,7 +545,9 @@ impl Body {
self.smlib
.get_or_init(|| solidcraft_smlib::Brep::from_record(&self.record, true).map_err(|e| Refusal::of(&self.record, &e)))
.as_ref()
- .map_err(|r| if r.internal { KernelError::Internal(format!("SMLib: {}", r.why)) } else { KernelError::Failed(format!("SMLib: {}", r.why)) })
+ .map_err(
+ |r| if r.internal { KernelError::Internal(format!("SMLib: {}", r.why)) } else { KernelError::Failed(format!("SMLib: {}", r.why)) },
+ )
}
/// Why SMLib refuses the body, if it does: the body is sent into SMLib as an operation
diff --git a/crates/kernel/src/issue_851_tests.rs b/crates/kernel/src/issue_851_tests.rs
index c924e8a441..1518afa877 100644
--- a/crates/kernel/src/issue_851_tests.rs
+++ b/crates/kernel/src/issue_851_tests.rs
@@ -375,10 +375,7 @@ fn a_ball_as_wide_as_the_round_it_rolls_on_is_refused_saying_why() {
Err(KernelError::TooLarge(why)) => why,
other => panic!("{:?}", other.map(|b| b.face_count())),
};
- assert!(
- why.contains("the ball is as wide as a face it rolls on, so its centre stays put and the round cannot end at the edge's end"),
- "{why}"
- );
+ assert!(why.contains("the ball is as wide as a face it rolls on, so its centre stays put and the round cannot end at the edge's end"), "{why}");
// 2 less solidcore's fit margin.
let largest: f64 = why
.split_once("the largest radius that fits is ")
diff --git a/crates/kernel/src/lib.rs b/crates/kernel/src/lib.rs
index 0bee1456ee..480bb6bf06 100644
--- a/crates/kernel/src/lib.rs
+++ b/crates/kernel/src/lib.rs
@@ -157,8 +157,8 @@ pub mod watch;
pub use blend::{
ChamferSide, SETBACK_AT_LEAST, blend_edges, chamfer, chamfer_max, chamfer_sides, fillet, fillet_each, fillet_g2, fillet_g2_corners,
- fillet_g2_with_g2_corners, fillet_least_setback, fillet_max, fillet_max_each, fillet_removing, fillet_setback, largest_fit_note, names_largest_fit, tangent_chain,
- with_fit_note,
+ fillet_g2_with_g2_corners, fillet_least_setback, fillet_max, fillet_max_each, fillet_removing, fillet_setback, largest_fit_note,
+ names_largest_fit, tangent_chain, with_fit_note,
};
pub use blend_corner::fillet_radii;
pub use blend_variable::{RadiusSpline, Taper, fillet_chord, fillet_tapered, fillet_variable, fillet_variable_points, fillet_variable_spline, taper};
diff --git a/crates/kernel/src/par.rs b/crates/kernel/src/par.rs
index d0dff432f5..972bac0d81 100644
--- a/crates/kernel/src/par.rs
+++ b/crates/kernel/src/par.rs
@@ -122,8 +122,7 @@ pub fn map_on_threads<T: Sync, R: Send>(items: &[T], max_threads: usize, f: impl
let mut out: Vec<Option<R>> = std::iter::repeat_with(|| None).take(items.len()).collect();
std::thread::scope(|scope| {
// A thread that cannot start leaves its share to the others.
- let helpers: Vec<_> =
- (1..threads).filter_map(|_| kernel_thread("solidcraft-each").spawn_scoped(scope, work).ok()).collect();
+ let helpers: Vec<_> = (1..threads).filter_map(|_| kernel_thread("solidcraft-each").spawn_scoped(scope, work).ok()).collect();
let mut all = work();
for h in helpers {
// `work` never panics (every item runs under the guard).
diff --git a/crates/smlib/src/core/offset.rs b/crates/smlib/src/core/offset.rs
index 8c09cc6e11..25d1d3a6f6 100644
--- a/crates/smlib/src/core/offset.rs
+++ b/crates/smlib/src/core/offset.rs
@@ -18,7 +18,6 @@
use solidcore::EntityRef;
use solidcore::SolidError;
-use solidcore::offset::construction::ShellRefusal;
use solidcore::geom::attribute::{Attribute, Behavior, ids};
use solidcore::geom::axis2_placement::Axis2Placement;
use solidcore::geom::object::Shape;
@@ -30,6 +29,7 @@ use solidcore::nurbs::b_spline_curve::ControlPointForm;
use solidcore::nurbs::b_spline_surface::p1::SurfParamType;
use solidcore::nurbs::b_spline_surface_n_lib::p2::OrientType;
use solidcore::nurbs::knots::Side;
+use solidcore::offset::construction::ShellRefusal;
use solidcore::offset::offset_executive::p2::{OffsetOptions, ShellOptions, local_operation_simple, offset_brep_simple, shell_brep_simple};
use solidcore::offset::offset_faces::{OffsetFacesExecutive, OffsetFacesRefusal};
use solidcore::query::api_queries::{face_bounding_box, face_classify_uv, face_closest_point_in_shape, face_internal_point};
diff --git a/crates/smlib/src/core/split.rs b/crates/smlib/src/core/split.rs
index 8d593c88ce..6a9cb38ad0 100644
--- a/crates/smlib/src/core/split.rs
+++ b/crates/smlib/src/core/split.rs
@@ -51,9 +51,9 @@ use solidcore::topology::edge::NotifyEnv;
use solidcore::topology::face::p2 as face_p2;
use solidcore::topology::{Brep, EdgeId, FaceId};
+use super::Body;
use super::blend::status;
use super::sweep::build_faces;
-use super::Body;
use crate::ssi::Spec;
use crate::{Error, Result};
use solidcore::topology::brep::p3::brep_copy;