Skip to content

Commit

Permalink
remove use of unwrap
Browse files Browse the repository at this point in the history
Signed-off-by: Teo Koon Peng <[email protected]>
  • Loading branch information
koonpeng committed Feb 5, 2025
1 parent 1137c08 commit 9bc7cfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions macros/src/buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub(crate) fn impl_buffer_map_layout(ast: DeriveInput) -> Result<TokenStream> {
) -> Result<usize, OperationError> {
#(
let #field_ident = world
.get_entity(buffers.get(#map_key).unwrap().id())
.get_entity(buffers.get(#map_key).or_broken()?.id())
.or_broken()?
.buffered_count::<#field_type>(session)?;
)*
Expand All @@ -49,7 +49,7 @@ pub(crate) fn impl_buffer_map_layout(ast: DeriveInput) -> Result<TokenStream> {
) -> OperationResult {
#(
world
.get_entity_mut(buffers.get(#map_key).unwrap().id())
.get_entity_mut(buffers.get(#map_key).or_broken()?.id())
.or_broken()?
.ensure_session::<#field_type>(session)?;
)*
Expand All @@ -68,7 +68,7 @@ pub(crate) fn impl_buffer_map_layout(ast: DeriveInput) -> Result<TokenStream> {
) -> Result<Self, OperationError> {
#(
let #field_ident = world
.get_entity_mut(buffers.get(#map_key).unwrap().id())
.get_entity_mut(buffers.get(#map_key).or_broken()?.id())
.or_broken()?
.pull_from_buffer::<#field_type>(session)?;
)*
Expand Down

0 comments on commit 9bc7cfe

Please sign in to comment.