Skip to content

Commit 6852fcc

Browse files
committed
Implement Debug for Local
1 parent 88bc95d commit 6852fcc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/bevy_ecs/src/system/system_param.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,19 @@ impl<'a> SystemParamFetch<'a> for CommandQueue {
547547
/// ```
548548
pub struct Local<'a, T: Component>(&'a mut T);
549549

550+
impl<'a, T: Component> Debug for Local<'a, T>
551+
where
552+
T: Debug,
553+
{
554+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
555+
f.write_str("NonSendMut(")?;
556+
Debug::fmt(self.0, f)?;
557+
f.write_str(")")?;
558+
559+
Ok(())
560+
}
561+
}
562+
550563
impl<'a, T: Component> Deref for Local<'a, T> {
551564
type Target = T;
552565

0 commit comments

Comments
 (0)