File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -358,13 +358,15 @@ pub struct EventConsumer<'a, T: Component> {
358
358
359
359
impl < ' a , T : Component > EventConsumer < ' a , T > {
360
360
/// Drains all available events this EventConsumer has access to into an iterator
361
- pub fn drain ( self ) -> impl DoubleEndedIterator < Item = T > {
362
- self . events . drain ( )
361
+ pub fn drain ( self ) -> impl DoubleEndedIterator < Item = T > + ' a {
362
+ // into_inner is needed to ensure the lifetime is not bound to the implicit .deref_mut() call
363
+ self . events . into_inner ( ) . drain ( )
363
364
}
364
365
365
366
/// Drains all available events this EventConsumer has access to into an iterator and returns the id
366
- pub fn drain_with_id ( self ) -> impl DoubleEndedIterator < Item = ( T , EventId < T > ) > {
367
- self . events . drain_with_id ( )
367
+ pub fn drain_with_id ( self ) -> impl DoubleEndedIterator < Item = ( T , EventId < T > ) > + ' a {
368
+ // into_inner is needed to ensure the lifetime is not bound to the implicit .deref_mut() call
369
+ self . events . into_inner ( ) . drain_with_id ( )
368
370
}
369
371
}
370
372
You can’t perform that action at this time.
0 commit comments