summaryrefslogtreecommitdiffstats
path: root/web/src/widget/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-07-01 07:36:42 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-07-01 07:36:42 +0200
commit75464ad89422884e0718eb0429586a9d77f61c71 (patch)
tree5456ff6db21375d8b3814e6bb9c4c56649b135e3 /web/src/widget/text.rs
parentd873c37e31fb052fb376caada6780137e176a6e7 (diff)
downloadiced-75464ad89422884e0718eb0429586a9d77f61c71.tar.gz
iced-75464ad89422884e0718eb0429586a9d77f61c71.tar.bz2
iced-75464ad89422884e0718eb0429586a9d77f61c71.zip
Use `String::from_str_in` in `iced_web`
Diffstat (limited to 'web/src/widget/text.rs')
-rw-r--r--web/src/widget/text.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/web/src/widget/text.rs b/web/src/widget/text.rs
index 3ec565a8..2f7308ee 100644
--- a/web/src/widget/text.rs
+++ b/web/src/widget/text.rs
@@ -116,7 +116,12 @@ impl<'a, Message> Widget<Message> for Text {
) -> dodrio::Node<'b> {
use dodrio::builder::*;
- let content = bumpalo::format!(in bump, "{}", self.content);
+ let content = {
+ use dodrio::bumpalo::collections::String;
+
+ String::from_str_in(&self.content, bump)
+ };
+
let color = self
.color
.map(css::color)
@@ -133,7 +138,8 @@ impl<'a, Message> Widget<Message> for Text {
let style = bumpalo::format!(
in bump,
- "width: {}; height: {}; font-size: {}px; color: {}; text-align: {}; font-family: {}",
+ "width: {}; height: {}; font-size: {}px; color: {}; \
+ text-align: {}; font-family: {}",
width,
height,
self.size.unwrap_or(20),