Skip to content

Commit

Permalink
Replace unwrap with silent error (!)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Apr 17, 2024
1 parent b689180 commit c4976d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/default_loggers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,17 +265,17 @@ fn bevy_sprite<'w>(
})
.flatten()
.and_then(|tex| {
tex.image_height_width_channels().map(|[w, h, _]| {
tex.image_height_width_channels().and_then(|[w, h, _]| {
let mesh = PlaneMeshBuilder::default()
.normal(Direction3d::Z)
.size(w as _, h as _)
.build();
mesh.to_rerun()
.unwrap()
.with_mesh_material(rerun::Material::from_albedo_factor(
mesh.to_rerun().map(|mesh| {
mesh.with_mesh_material(rerun::Material::from_albedo_factor(
sprite.color.to_rerun().0,
))
.with_albedo_texture(tex)
})
})
})
})
Expand Down

0 comments on commit c4976d2

Please sign in to comment.