From 99ea5727ca4638efd2979218a128e56c0ce32c44 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 29 Feb 2024 19:57:59 +0100 Subject: feat(ecs): add iterating over queries non-mutably --- ecs/examples/simple.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ecs/examples/simple.rs') 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); } } -- cgit v1.2.3-18-g5258