summaryrefslogtreecommitdiff
path: root/ecs/examples/with_local.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/examples/with_local.rs')
-rw-r--r--ecs/examples/with_local.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ecs/examples/with_local.rs b/ecs/examples/with_local.rs
index 334f129..b37a5c3 100644
--- a/ecs/examples/with_local.rs
+++ b/ecs/examples/with_local.rs
@@ -20,18 +20,18 @@ struct SayHelloState
cnt: usize,
}
-fn say_hello(mut query: Query<(SomeData,)>, mut state: Local<SayHelloState>)
+fn say_hello(query: Query<(SomeData,)>, mut state: Local<SayHelloState>)
{
- for (data,) in query.iter_mut() {
+ for (data,) in &query {
println!("Hello there. Count {}: {}", state.cnt, data.num);
state.cnt += 1;
}
}
-fn say_whats_up(mut 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.iter_mut() {
+ for (data, name) in &query {
println!(
"Whats up, {}. Number is {}. Count {}",
name.name, data.num, state.cnt