diff --git a/src/main.rs b/src/main.rs index a0c021b..e08f03b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,9 +24,19 @@ fn greet_people(query: Query<&Name, With>) { } } +fn update_people(mut query: Query<&mut Name, With>) { + + for mut name in &mut query { + if name.0 == "Orlando Tampa" { + name.0 = "Carlos Satanick".to_string(); + } + break; + } +} + fn main() { App::new() .add_systems(Startup, add_people) - .add_systems(Update, (gamarjoba, greet_people)) + .add_systems(Update, (gamarjoba, (update_people, greet_people).chain())) .run(); }