Skip to content

Commit

Permalink
Fix error in dyn_sys_data example that only appears with the MSRV
Browse files Browse the repository at this point in the history
  • Loading branch information
Imberflur committed Apr 25, 2023
1 parent d308be2 commit b57f065
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/dyn_sys_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,14 @@ impl<'a> System<'a> for DynamicSystem {
.writes
.iter_mut()
.map(|resource| {
meta.get_mut(&mut **resource).expect(
// For some reason this needs a type ascription, otherwise Rust will think it's
// a `&mut (Reflaction + '_)` (as opposed to `&mut (Reflection + 'static)`. (Note this
// isn't needed in newer rust version but fails on the MSRV of 1.59.0).
let res: &mut dyn Reflection = meta.get_mut(&mut **resource).expect(
"Not registered in meta \
table",
)
);
res
})
.collect();

Expand Down

0 comments on commit b57f065

Please sign in to comment.