summaryrefslogtreecommitdiffstats
path: root/examples/todos
diff options
context:
space:
mode:
authorLibravatar Ram.Type-0 <p0211@live.jp>2021-11-01 23:41:16 +0900
committerLibravatar Ram.Type-0 <p0211@live.jp>2021-11-02 00:05:25 +0900
commit0245f289b201c8b352dcffcd35e0f0d283085ee2 (patch)
treee0088aabd9a4a1a8a099ed3ae05517c52dfe946f /examples/todos
parent8a2a7f7e2144542b47c1d259f296ad7dcc5f3cf9 (diff)
downloadiced-0245f289b201c8b352dcffcd35e0f0d283085ee2.tar.gz
iced-0245f289b201c8b352dcffcd35e0f0d283085ee2.tar.bz2
iced-0245f289b201c8b352dcffcd35e0f0d283085ee2.zip
Remove unnecessary String allocation
Remove unnecessary String allocation by passing &format! or &x.to_string as impl Into<String>
Diffstat (limited to 'examples/todos')
-rw-r--r--examples/todos/src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index 11f23fd4..4d657cc0 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -374,7 +374,7 @@ impl Controls {
.spacing(20)
.align_items(Alignment::Center)
.push(
- Text::new(&format!(
+ Text::new(format!(
"{} {} left",
tasks_left,
if tasks_left == 1 { "task" } else { "tasks" }
@@ -464,7 +464,7 @@ const ICONS: Font = Font::External {
};
fn icon(unicode: char) -> Text {
- Text::new(&unicode.to_string())
+ Text::new(unicode.to_string())
.font(ICONS)
.width(Length::Units(20))
.horizontal_alignment(alignment::Horizontal::Center)