Fix format

This commit is contained in:
Kaiden42 2020-10-03 20:30:08 +02:00 committed by Héctor Ramón
parent e00fca6372
commit 2a5aa69024

View File

@ -43,7 +43,11 @@ impl<Message> Toggler<Message> {
/// `Message`. /// `Message`.
/// ///
/// [`Toggler`]: struct.Toggler.html /// [`Toggler`]: struct.Toggler.html
pub fn new<F>(is_active: bool, label: impl Into<Option<String>>, f: F) -> Self pub fn new<F>(
is_active: bool,
label: impl Into<Option<String>>,
f: F,
) -> Self
where where
F: 'static + Fn(bool) -> Message, F: 'static + Fn(bool) -> Message,
{ {
@ -95,9 +99,10 @@ where
use dodrio::builder::*; use dodrio::builder::*;
use dodrio::bumpalo::collections::String; use dodrio::bumpalo::collections::String;
let toggler_label = &self.label.as_ref().map(|label| { let toggler_label = &self
String::from_str_in(&label, bump).into_bump_str() .label
}); .as_ref()
.map(|label| String::from_str_in(&label, bump).into_bump_str());
let event_bus = bus.clone(); let event_bus = bus.clone();
let on_toggle = self.on_toggle.clone(); let on_toggle = self.on_toggle.clone();
@ -125,9 +130,7 @@ where
}) })
.finish(); .finish();
let toggler = span(bump) let toggler = span(bump).children(vec![span(bump).finish()]).finish();
.children(vec![span(bump).finish()])
.finish();
label label
.attr( .attr(