summaryrefslogtreecommitdiffstats
path: root/examples/tour/src/main.rs
diff options
context:
space:
mode:
authorLibravatar Richard Custodio <richardcustodio@pm.me>2024-03-18 17:08:56 -0300
committerLibravatar Richard Custodio <richardcustodio@pm.me>2024-03-18 17:08:56 -0300
commitbf9bbf4a3edf22f21c79901999cc104cb29fccce (patch)
tree2a2b041471940c0fc1809e3db677a0a53758181c /examples/tour/src/main.rs
parent6146382676a7bff4764e86e99d0d053f5fbbc045 (diff)
downloadiced-bf9bbf4a3edf22f21c79901999cc104cb29fccce.tar.gz
iced-bf9bbf4a3edf22f21c79901999cc104cb29fccce.tar.bz2
iced-bf9bbf4a3edf22f21c79901999cc104cb29fccce.zip
refactor: replace `text(format!(` with `text` macro
Diffstat (limited to '')
-rw-r--r--examples/tour/src/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs
index a88c0dba..3fb8b460 100644
--- a/examples/tour/src/main.rs
+++ b/examples/tour/src/main.rs
@@ -433,7 +433,7 @@ impl<'a> Step {
let spacing_section = column![
slider(0..=80, spacing, StepMessage::SpacingChanged),
- text(format!("{spacing} px"))
+ text!("{spacing} px")
.width(Length::Fill)
.horizontal_alignment(alignment::Horizontal::Center),
]
@@ -457,7 +457,7 @@ impl<'a> Step {
fn text(size: u16, color: Color) -> Column<'a, StepMessage> {
let size_section = column![
"You can change its size:",
- text(format!("This text is {size} pixels")).size(size),
+ text!("This text is {size} pixels").size(size),
slider(10..=70, size, StepMessage::TextSizeChanged),
]
.padding(20)
@@ -472,7 +472,7 @@ impl<'a> Step {
let color_section = column![
"And its color:",
- text(format!("{color:?}")).color(color),
+ text!("{color:?}").color(color),
color_sliders,
]
.padding(20)
@@ -544,7 +544,7 @@ impl<'a> Step {
.push(ferris(width, filter_method))
.push(slider(100..=500, width, StepMessage::ImageWidthChanged))
.push(
- text(format!("Width: {width} px"))
+ text!("Width: {width} px")
.width(Length::Fill)
.horizontal_alignment(alignment::Horizontal::Center),
)