Skip to content

Commit

Permalink
use .to_string() instead of format
Browse files Browse the repository at this point in the history
  • Loading branch information
wilk10 committed Feb 23, 2023
1 parent 827ba65 commit c905843
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/ecs/apply_system_buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
.with_children(|parent| {
parent.spawn((
TextBundle::from_section(
format!("Apple: nothing counted yet"),
"Apple: nothing counted yet".to_string(),
TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 80.0,
Expand All @@ -81,7 +81,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
));
parent.spawn((
TextBundle::from_section(
format!("Orange: nothing counted yet"),
"Orange: nothing counted yet".to_string(),
TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 80.0,
Expand Down Expand Up @@ -139,9 +139,9 @@ fn count_apple(
if timers.repeating.just_finished() {
let mut apples_text = apple_count.single_mut();
apples_text.sections[0].value = if apple.is_empty() {
format!("Apple: not counted")
"Apple: not counted".to_string()
} else {
format!("Apple: counted")
"Apple: counted".to_string()
};
}
}
Expand All @@ -162,9 +162,9 @@ fn count_orange(
if timers.repeating.just_finished() {
let mut oranges_text = orange_count.single_mut();
oranges_text.sections[0].value = if orange.is_empty() {
format!("Orange: not counted")
"Orange: not counted".to_string()
} else {
format!("Orange: counted")
"Orange: counted".to_string()
};
}
}

0 comments on commit c905843

Please sign in to comment.