mirror of https://github.com/hannobraun/Fornjot
Change style of `infer_surface_form`
This commit is contained in:
parent
807f824746
commit
6f8f06f261
|
@ -11,11 +11,11 @@ use crate::{
|
|||
/// Builder API for [`PartialVertex`]
|
||||
pub trait VertexBuilder {
|
||||
/// Remove the surface form of the partial vertex, inferring it on build
|
||||
fn infer_surface_form(self) -> Self;
|
||||
fn infer_surface_form(&mut self) -> &mut Self;
|
||||
}
|
||||
|
||||
impl VertexBuilder for PartialVertex {
|
||||
fn infer_surface_form(mut self) -> Self {
|
||||
fn infer_surface_form(&mut self) -> &mut Self {
|
||||
self.surface_form = PartialSurfaceVertex::default().into();
|
||||
self
|
||||
}
|
||||
|
|
|
@ -95,7 +95,8 @@ mod tests {
|
|||
|
||||
// Sever connection between the last and first half-edge in the
|
||||
// cycle.
|
||||
let first_vertex = first_vertex.into_partial().infer_surface_form();
|
||||
let mut first_vertex = first_vertex.into_partial();
|
||||
first_vertex.infer_surface_form();
|
||||
*first_half_edge = first_half_edge
|
||||
.clone()
|
||||
.with_back_vertex(first_vertex)
|
||||
|
|
|
@ -308,10 +308,8 @@ mod tests {
|
|||
|vertex| -> anyhow::Result<_, ValidationError> {
|
||||
let mut vertex = vertex.to_partial();
|
||||
vertex.position = Some([0.].into());
|
||||
Ok(vertex
|
||||
.infer_surface_form()
|
||||
.build(&objects)?
|
||||
.insert(&objects)?)
|
||||
vertex.infer_surface_form();
|
||||
Ok(vertex.build(&objects)?.insert(&objects)?)
|
||||
},
|
||||
)?,
|
||||
valid.global_form().clone(),
|
||||
|
|
Loading…
Reference in New Issue