summaryrefslogtreecommitdiff
path: root/ecs/examples/simple.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-02-29 19:57:59 +0100
committerHampusM <hampus@hampusmat.com>2024-02-29 19:58:10 +0100
commit99ea5727ca4638efd2979218a128e56c0ce32c44 (patch)
treef167d9d88ad8b4cfe7089df3cc67e1be9b0f9a06 /ecs/examples/simple.rs
parentbd627c91819ea98e551b29027de6eaaccbe45ed6 (diff)
feat(ecs): add iterating over queries non-mutably
Diffstat (limited to 'ecs/examples/simple.rs')
-rw-r--r--ecs/examples/simple.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ecs/examples/simple.rs b/ecs/examples/simple.rs
index b8dc50f..76d9538 100644
--- a/ecs/examples/simple.rs
+++ b/ecs/examples/simple.rs
@@ -12,9 +12,9 @@ struct Greeting
greeting: String,
}
-fn say_hello(mut query: Query<(SomeData, Greeting)>)
+fn say_hello(query: Query<(SomeData, Greeting)>)
{
- for (data, greeting) in query.iter_mut() {
+ for (data, greeting) in &query {
println!("{}: {}", greeting.greeting, data.num);
}
}