Skip to content

Commit 5d4bfaf

Browse files
committed
Feature gated io code in tutorial
1 parent 1409bc1 commit 5d4bfaf

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

examples/tutorial.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,14 @@ fn main() {
8080
* IO: loading and saving meshes
8181
*/
8282

83-
meshx::io::save_trimesh(&mesh, "tests/artifacts/tutorial_trimesh.vtk")
84-
.expect("Failed to save the tutorial triangle mesh");
83+
#[cfg(features = "io")]
84+
{
85+
meshx::io::save_trimesh(&mesh, "tests/artifacts/tutorial_trimesh.vtk")
86+
.expect("Failed to save the tutorial triangle mesh");
8587

86-
let loaded_mesh = meshx::io::load_trimesh("tests/artifacts/tutorial_trimesh.vtk")
87-
.expect("Failed to load the tutorial triangle mesh");
88+
let loaded_mesh = meshx::io::load_trimesh("tests/artifacts/tutorial_trimesh.vtk")
89+
.expect("Failed to load the tutorial triangle mesh");
8890

89-
assert_eq!(mesh, loaded_mesh);
91+
assert_eq!(mesh, loaded_mesh);
92+
}
9093
}

0 commit comments

Comments
 (0)