summaryrefslogtreecommitdiff
path: root/ecs/examples/with_local.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2025-01-05 22:03:34 +0100
committerHampusM <hampus@hampusmat.com>2025-01-05 22:03:34 +0100
commita44e663eb6d4aaf567dd35f2676014ba5aaa9e00 (patch)
treecd81d1f61b33e1905d6b3def851e5be18838556b /ecs/examples/with_local.rs
parentcd385ddedc767c953f24109ec3ffe0a07d247ff5 (diff)
feat(ecs): allow control over component mutability in query
Diffstat (limited to 'ecs/examples/with_local.rs')
-rw-r--r--ecs/examples/with_local.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ecs/examples/with_local.rs b/ecs/examples/with_local.rs
index 0872dfc..4658fc0 100644
--- a/ecs/examples/with_local.rs
+++ b/ecs/examples/with_local.rs
@@ -21,7 +21,7 @@ struct SayHelloState
cnt: usize,
}
-fn say_hello(query: Query<(SomeData,)>, mut state: Local<SayHelloState>)
+fn say_hello(query: Query<(&SomeData,)>, mut state: Local<SayHelloState>)
{
for (data,) in &query {
println!("Hello there. Count {}: {}", state.cnt, data.num);
@@ -30,7 +30,7 @@ fn say_hello(query: Query<(SomeData,)>, mut state: Local<SayHelloState>)
}
}
-fn say_whats_up(query: Query<(SomeData, Name)>, mut state: Local<SayHelloState>)
+fn say_whats_up(query: Query<(&SomeData, &Name)>, mut state: Local<SayHelloState>)
{
for (data, name) in &query {
println!(