@@ -10,6 +10,7 @@ use crate::{
10
10
pub use bevy_ecs_macros:: SystemParam ;
11
11
use bevy_ecs_macros:: { all_tuples, impl_query_set} ;
12
12
use std:: {
13
+ fmt:: Debug ,
13
14
marker:: PhantomData ,
14
15
ops:: { Deref , DerefMut } ,
15
16
} ;
@@ -174,6 +175,15 @@ pub struct Res<'w, T: Component> {
174
175
change_tick : u32 ,
175
176
}
176
177
178
+ impl < ' w , T : Component > Debug for Res < ' w , T >
179
+ where
180
+ T : Debug ,
181
+ {
182
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
183
+ f. debug_tuple ( "Res" ) . field ( & self . value ) . finish ( )
184
+ }
185
+ }
186
+
177
187
impl < ' w , T : Component > Res < ' w , T > {
178
188
/// Returns true if (and only if) this resource been added since the last execution of this
179
189
/// system.
@@ -318,6 +328,15 @@ pub struct ResMut<'w, T: Component> {
318
328
change_tick : u32 ,
319
329
}
320
330
331
+ impl < ' w , T : Component > Debug for ResMut < ' w , T >
332
+ where
333
+ T : Debug ,
334
+ {
335
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
336
+ f. debug_tuple ( "ResMut" ) . field ( & self . value ) . finish ( )
337
+ }
338
+ }
339
+
321
340
impl < ' w , T : Component > ResMut < ' w , T > {
322
341
/// Returns true if (and only if) this resource been added since the last execution of this
323
342
/// system.
@@ -520,6 +539,15 @@ impl<'a> SystemParamFetch<'a> for CommandQueue {
520
539
/// ```
521
540
pub struct Local < ' a , T : Component > ( & ' a mut T ) ;
522
541
542
+ impl < ' a , T : Component > Debug for Local < ' a , T >
543
+ where
544
+ T : Debug ,
545
+ {
546
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
547
+ f. debug_tuple ( "Local" ) . field ( & self . 0 ) . finish ( )
548
+ }
549
+ }
550
+
523
551
impl < ' a , T : Component > Deref for Local < ' a , T > {
524
552
type Target = T ;
525
553
@@ -661,6 +689,15 @@ pub struct NonSend<'w, T> {
661
689
change_tick : u32 ,
662
690
}
663
691
692
+ impl < ' w , T > Debug for NonSend < ' w , T >
693
+ where
694
+ T : Debug ,
695
+ {
696
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
697
+ f. debug_tuple ( "NonSend" ) . field ( & self . value ) . finish ( )
698
+ }
699
+ }
700
+
664
701
impl < ' w , T : Component > NonSend < ' w , T > {
665
702
/// Returns true if (and only if) this resource been added since the last execution of this
666
703
/// system.
@@ -807,7 +844,7 @@ impl<'a, T: 'static> DerefMut for NonSendMut<'a, T> {
807
844
808
845
impl < ' a , T : ' static + core:: fmt:: Debug > core:: fmt:: Debug for NonSendMut < ' a , T > {
809
846
fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
810
- self . value . fmt ( f )
847
+ f . debug_tuple ( "NonSendMut" ) . field ( & self . value ) . finish ( )
811
848
}
812
849
}
813
850
0 commit comments