Use String::from_str_in in iced_web

This commit is contained in:
Héctor Ramón Jiménez 2020-07-01 07:36:42 +02:00
parent d873c37e31
commit 75464ad894
6 changed files with 67 additions and 40 deletions

View file

@ -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),