Skip to content

Commit

Permalink
simplify back an error propagation code
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Nov 15, 2024
1 parent aa3ed33 commit b050bb9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions crates/rapier3d-meshloader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,11 @@ pub fn load_from_path(
let scene = loader.load(path)?;
for (raw_mesh, _) in scene.meshes.into_iter().zip(scene.materials) {
let shape = load_from_raw_mesh(&raw_mesh, converter, scale);
colliders.push(match shape {
Ok((shape, pose)) => Ok(LoadedShape {
shape,
pose,
raw_mesh,
}),
Err(e) => Err(e),
});
colliders.push(shape.map(|(shape, pose)| LoadedShape {
shape,
pose,
raw_mesh,
}));
}
Ok(colliders)
}
Expand Down

0 comments on commit b050bb9

Please sign in to comment.