Skip to content

Commit 631853a

Browse files
committed
Document unsafe functions in mfem-sys example
2 parents e1be1bd + d2eaa3e commit 631853a

File tree

1 file changed

+3
-1
lines changed
  • crates/mfem-sys/examples

1 file changed

+3
-1
lines changed

crates/mfem-sys/examples/ex1.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,12 @@ fn ConstantCoefficient_into_Coefficient(
229229
}
230230

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

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

@@ -248,6 +250,6 @@ fn slice_mut_of_Vector(v: Pin<&mut Vector>) -> &mut [real_t] {
248250
}
249251

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

0 commit comments

Comments
 (0)