Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mkovaxx committed Feb 8, 2025
1 parent a4d03a5 commit d67ce58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/mfem-sys/examples/ex1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,12 @@ fn ConstantCoefficient_into_Coefficient(
}

fn LinearForm_as_Vector(x: &LinearForm) -> &Vector {
// LinearForm is a subclass of Vector.
unsafe { std::mem::transmute::<&LinearForm, &Vector>(x) }
}

fn LinearForm_as_Vector_mut(x: Pin<&mut LinearForm>) -> Pin<&mut Vector> {
// LinearForm is a subclass of Vector.
unsafe { std::mem::transmute::<Pin<&mut LinearForm>, Pin<&mut Vector>>(x) }
}

Expand All @@ -249,5 +251,6 @@ fn slice_mut_of_Vector(v: Pin<&mut Vector>) -> &mut [f64] {
}

fn GSSmoother_as_mut_Solver(s: Pin<&mut GSSmoother>) -> Pin<&mut Solver> {
// GSSmoother is a subclass of Solver.
unsafe { std::mem::transmute::<Pin<&mut GSSmoother>, Pin<&mut Solver>>(s) }
}

0 comments on commit d67ce58

Please sign in to comment.