diff --git a/kayak_core/src/node.rs b/kayak_core/src/node.rs index 211a6bc7ac5bd10630af00a9f95dfb30700d3312..ac3b309335e37c62a238d8282c374b09986dee73 100644 --- a/kayak_core/src/node.rs +++ b/kayak_core/src/node.rs @@ -15,7 +15,7 @@ pub struct Node { impl Node {} pub struct NodeBuilder { - node: Node + node: Node, } impl NodeBuilder { @@ -26,8 +26,8 @@ impl NodeBuilder { id: Index::default(), resolved_styles: Style::default(), raw_styles: None, - z: 0.0 - } + z: 0.0, + }, } } @@ -38,8 +38,8 @@ impl NodeBuilder { id, resolved_styles: styles, raw_styles: None, - z: 0.0 - } + z: 0.0, + }, } } diff --git a/kayak_core/src/styles.rs b/kayak_core/src/styles.rs index bdebf85ec1248f9c3f9dbea254e4c1823a9e94de..3929618113e42e3ec855fe304b2ddedf7b71e077 100644 --- a/kayak_core/src/styles.rs +++ b/kayak_core/src/styles.rs @@ -21,8 +21,8 @@ pub enum StyleProp<T: Default + Clone> { } impl<T> Default for StyleProp<T> - where - T: Default + Clone, +where + T: Default + Clone, { fn default() -> Self { Self::Unset @@ -30,8 +30,8 @@ impl<T> Default for StyleProp<T> } impl<T> StyleProp<T> - where - T: Default + Clone, +where + T: Default + Clone, { pub fn resolve(&self) -> T { match self { @@ -48,7 +48,7 @@ impl<T> StyleProp<T> pub fn select<'a>(props: &'_ [&'a StyleProp<T>]) -> &'a Self { for prop in props { if !matches!(prop, StyleProp::Unset) { - return prop + return prop; } } @@ -231,4 +231,4 @@ impl AsRefOption<Style> for &Option<Style> { fn as_ref_option(&self) -> Option<&Style> { self.as_ref() } -} \ No newline at end of file +} diff --git a/kayak_core/src/widget_manager.rs b/kayak_core/src/widget_manager.rs index 05338f096110c6c072cfcc96a6ec938c4e912bc2..101a121c30a136c64a953e7457eb79daaf28f48c 100644 --- a/kayak_core/src/widget_manager.rs +++ b/kayak_core/src/widget_manager.rs @@ -1,7 +1,5 @@ -use std::{ - sync::{Arc, Mutex}, -}; use indexmap::IndexSet; +use std::sync::{Arc, Mutex}; use crate::layout_cache::Rect; use crate::{ diff --git a/src/widgets/button.rs b/src/widgets/button.rs index ef4d0e385ab7c4cd90d568085374c3e9f88448fc..d42de1f9059ac7e737b6f0674cdfbf01b8d953e6 100644 --- a/src/widgets/button.rs +++ b/src/widgets/button.rs @@ -52,7 +52,7 @@ pub fn Button(props: ButtonProps) { padding_left: StyleProp::Value(Units::Stretch(1.0)), padding_right: StyleProp::Value(Units::Stretch(1.0)), ..Default::default() - }) + }), ); rsx! { diff --git a/src/widgets/text_box.rs b/src/widgets/text_box.rs index 881941ca25bf5dcea15beed67d4de10a03c8b305..1a7514fccedf136742ca07cb35b9f3b20225db90 100644 --- a/src/widgets/text_box.rs +++ b/src/widgets/text_box.rs @@ -95,7 +95,7 @@ pub fn TextBox(props: TextBoxProps) { bottom: Units::Pixels(0.0).into(), height: Units::Pixels(26.0).into(), ..Default::default() - }) + }), ); let background_styles = Style { diff --git a/src/widgets/tooltip.rs b/src/widgets/tooltip.rs index 173de7f2be52b1d1ecb9bea0330c1e099635f4e8..71b5df916c9f269c215891ac905128860a6c63c0 100644 --- a/src/widgets/tooltip.rs +++ b/src/widgets/tooltip.rs @@ -111,13 +111,17 @@ pub fn TooltipProvider(props: TooltipProviderProps) { width: StyleProp::Value(Units::Pixels(size.0)), height: StyleProp::Value(Units::Pixels(size.1)), ..Default::default() - }) + }), ); let base_styles = props.styles.clone().unwrap(); let mut tooltip_styles = Style { position_type: StyleProp::Value(PositionType::SelfDirected), - background_color: StyleProp::select(&[&base_styles.background_color, &Color::new(0.13, 0.15, 0.17, 0.85).into()]).clone(), + background_color: StyleProp::select(&[ + &base_styles.background_color, + &Color::new(0.13, 0.15, 0.17, 0.85).into(), + ]) + .clone(), width: StyleProp::Value(Units::Pixels(tooltip_size.0)), height: StyleProp::Value(Units::Pixels(tooltip_size.1)), ..Style::default() @@ -206,7 +210,7 @@ pub fn TooltipConsumer(props: TooltipConsumerProps) { width: StyleProp::Value(Units::Auto), height: StyleProp::Value(Units::Auto), ..Default::default() - }) + }), ); let data = context