diff --git a/Cargo.toml b/Cargo.toml index 7015919..bb61063 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raui" -version = "0.64.0" +version = "0.64.1" authors = ["Patryk 'PsichiX' Budzynski "] edition = "2021" description = "Renderer Agnostic User Interface" diff --git a/demos/in-game/src/model/inventory.rs b/demos/in-game/src/model/inventory.rs index 8833215..afabfb2 100644 --- a/demos/in-game/src/model/inventory.rs +++ b/demos/in-game/src/model/inventory.rs @@ -74,7 +74,7 @@ impl Inventory { pub fn owned<'a>( &'a self, database: &'a ItemsDatabase, - ) -> impl Iterator { + ) -> impl Iterator { self.owned .iter() .filter_map(|(id, count)| Some((id.as_str(), *count, database.items.get(id)?))) diff --git a/examples/context_box.rs b/examples/context_box.rs index a3c7e96..ac2a9e7 100644 --- a/examples/context_box.rs +++ b/examples/context_box.rs @@ -28,7 +28,7 @@ fn app(mut ctx: WidgetContext) -> WidgetNode { make_widget!(content_box) .idref(idref.clone()) - .with_shared_props(PortalsContainer(idref.into())) + .with_shared_props(PortalsContainer(idref)) .listed_slot( make_widget!(horizontal_box) .with_props(HorizontalBoxProps { diff --git a/examples/immediate_mode_stack_props.rs b/examples/immediate_mode_stack_props.rs index d9b4c08..fefac8e 100644 --- a/examples/immediate_mode_stack_props.rs +++ b/examples/immediate_mode_stack_props.rs @@ -77,5 +77,5 @@ mod gui { } fn main() { - ImmediateApp::simple("Immediate mode UI - Stack props", || gui::app()); + ImmediateApp::simple("Immediate mode UI - Stack props", gui::app); } diff --git a/examples/options_view.rs b/examples/options_view.rs index 066ab6b..b160cb8 100644 --- a/examples/options_view.rs +++ b/examples/options_view.rs @@ -32,7 +32,7 @@ fn app(mut ctx: WidgetContext) -> WidgetNode { // for option views to anchor thier content into. make_widget!(content_box) .idref(idref.clone()) - .with_shared_props(PortalsContainer(idref.into())) + .with_shared_props(PortalsContainer(idref)) .listed_slot( // Options view is basically a button that toggles its content anchored // to itself. You can think of dropdown/context menus, but actually it diff --git a/examples/options_view_map.rs b/examples/options_view_map.rs index 45cb8a0..7e8699a 100644 --- a/examples/options_view_map.rs +++ b/examples/options_view_map.rs @@ -32,7 +32,7 @@ fn app(mut ctx: WidgetContext) -> WidgetNode { make_widget!(content_box) .idref(idref.clone()) - .with_shared_props(PortalsContainer(idref.into())) + .with_shared_props(PortalsContainer(idref)) .listed_slot( make_widget!(options_view) .with_props(ContentBoxItemLayout { diff --git a/examples/portal_box.rs b/examples/portal_box.rs index 2fa604b..d700b4b 100644 --- a/examples/portal_box.rs +++ b/examples/portal_box.rs @@ -13,7 +13,7 @@ fn app(mut ctx: WidgetContext) -> WidgetNode { .idref(idref.clone()) // widget rederence marked as portals container and put into root shared props for any // portal box down the widget tree. More about how portal box works later. - .with_shared_props(PortalsContainer(idref.to_owned().into())) + .with_shared_props(PortalsContainer(idref.to_owned())) .listed_slot( make_widget!(anchor_box) .with_props(RelativeLayoutProps { diff --git a/examples/retained_mode.rs b/examples/retained_mode.rs index cbafacc..c7da52a 100644 --- a/examples/retained_mode.rs +++ b/examples/retained_mode.rs @@ -250,5 +250,5 @@ fn create_app(notifier: ChangeNotifier) -> View { } fn main() { - RetainedApp::simple("Retained mode UI", |notifier| create_app(notifier)); + RetainedApp::simple("Retained mode UI", create_app); } diff --git a/examples/setup.rs b/examples/setup.rs index cfc1975..da5ce9c 100644 --- a/examples/setup.rs +++ b/examples/setup.rs @@ -33,8 +33,8 @@ fn main() { // tree. application.apply(tree); - // This and the following function calls would need to be called every frame - loop { + // This scope content would need to be called every frame + { // Telling the app to `process` will make it perform any necessary updates. application.process(); @@ -73,8 +73,5 @@ fn main() { .render::<_, String, _>(&mapping, &mut renderer) .unwrap() ); - - // Let's not actually loop infinitely for this example - break; } } diff --git a/examples/tooltip_box.rs b/examples/tooltip_box.rs index faa56c8..d2e1897 100644 --- a/examples/tooltip_box.rs +++ b/examples/tooltip_box.rs @@ -12,7 +12,7 @@ fn app(mut ctx: WidgetContext) -> WidgetNode { make_widget!(content_box) .idref(idref.clone()) - .with_shared_props(PortalsContainer(idref.into())) + .with_shared_props(PortalsContainer(idref)) .listed_slot( make_widget!(horizontal_box) .with_props(HorizontalBoxProps { diff --git a/raui-app/Cargo.toml b/raui-app/Cargo.toml index 4957ece..3a5e3bb 100644 --- a/raui-app/Cargo.toml +++ b/raui-app/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raui-app" -version = "0.64.0" +version = "0.64.1" authors = ["Patryk 'PsichiX' Budzynski "] edition = "2021" description = "RAUI application layer to focus only on making UI" diff --git a/raui-app/src/lib.rs b/raui-app/src/lib.rs index 6844e28..d665dd2 100644 --- a/raui-app/src/lib.rs +++ b/raui-app/src/lib.rs @@ -109,7 +109,7 @@ pub(crate) struct TesselateToGraphics<'a> { projection_view_matrix: [f32; 16], } -impl<'a> TesselateBatchConverter for TesselateToGraphics<'a> { +impl TesselateBatchConverter for TesselateToGraphics<'_> { fn convert(&mut self, batch: TesselateBatch) -> Option { match batch { TesselateBatch::Color => Some(GraphicsBatch { diff --git a/raui-core/Cargo.toml b/raui-core/Cargo.toml index 44fa59f..2ff581a 100644 --- a/raui-core/Cargo.toml +++ b/raui-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raui-core" -version = "0.64.0" +version = "0.64.1" authors = ["Patryk 'PsichiX' Budzynski "] edition = "2021" description = "RAUI application layer" @@ -14,4 +14,4 @@ categories = ["gui", "rendering::graphics-api"] raui-derive = { version = "0.64", path = "../raui-derive" } serde = { version = "1", features = ["derive"] } serde_json = "1.0" -intuicio-data = "0.33" +intuicio-data = "0.39" diff --git a/raui-core/src/layout/mod.rs b/raui-core/src/layout/mod.rs index 76ea40e..ee2ba70 100644 --- a/raui-core/src/layout/mod.rs +++ b/raui-core/src/layout/mod.rs @@ -27,7 +27,7 @@ impl<'a> LayoutSortedItems<'a> { } } -impl<'a> std::fmt::Debug for LayoutSortedItems<'a> { +impl std::fmt::Debug for LayoutSortedItems<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_map() .entries(self.0.iter().map(|&(k, v)| (k, v))) diff --git a/raui-core/src/view_model.rs b/raui-core/src/view_model.rs index 33a780e..13ecfa7 100644 --- a/raui-core/src/view_model.rs +++ b/raui-core/src/view_model.rs @@ -423,7 +423,7 @@ pub struct ViewModelObject<'a, T> { notifier: ViewModelNotifier, } -impl<'a, T> ViewModelObject<'a, T> { +impl ViewModelObject<'_, T> { pub fn set_unique_notify(&mut self, value: T) where T: PartialEq, @@ -435,7 +435,7 @@ impl<'a, T> ViewModelObject<'a, T> { } } -impl<'a, T> Deref for ViewModelObject<'a, T> { +impl Deref for ViewModelObject<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -443,7 +443,7 @@ impl<'a, T> Deref for ViewModelObject<'a, T> { } } -impl<'a, T> DerefMut for ViewModelObject<'a, T> { +impl DerefMut for ViewModelObject<'_, T> { fn deref_mut(&mut self) -> &mut Self::Target { self.notifier.notify(); &mut self.access @@ -534,9 +534,9 @@ mod tests { collection.insert(FOO_VIEW_MODEL.to_owned(), view_model); // unbound properties won't trigger notification until we bind widgets to them. - assert_eq!(collection.consume_notified_common_root().is_valid(), false); + assert!(!collection.consume_notified_common_root().is_valid()); handle.write().unwrap().toggle(); - assert_eq!(collection.consume_notified_common_root().is_valid(), false); + assert!(!collection.consume_notified_common_root().is_valid()); assert!(collection .get_mut(FOO_VIEW_MODEL) .unwrap() diff --git a/raui-core/src/widget/context.rs b/raui-core/src/widget/context.rs index 7047184..11a70df 100644 --- a/raui-core/src/widget/context.rs +++ b/raui-core/src/widget/context.rs @@ -23,7 +23,7 @@ pub struct WidgetContext<'a> { pub view_models: ViewModelCollectionView<'a>, } -impl<'a> WidgetContext<'a> { +impl WidgetContext<'_> { pub fn take_named_slots(&mut self) -> HashMap { std::mem::take(&mut self.named_slots) } @@ -45,7 +45,7 @@ impl<'a> WidgetContext<'a> { } } -impl<'a> std::fmt::Debug for WidgetContext<'a> { +impl std::fmt::Debug for WidgetContext<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("WidgetContext") .field("id", &self.id) diff --git a/raui-core/src/widget/mod.rs b/raui-core/src/widget/mod.rs index de59842..16f5b93 100644 --- a/raui-core/src/widget/mod.rs +++ b/raui-core/src/widget/mod.rs @@ -41,7 +41,7 @@ pub struct WidgetIdMetaParam<'a> { pub value: Option<&'a str>, } -impl<'a> WidgetIdMetaParam<'a> { +impl WidgetIdMetaParam<'_> { pub fn is_flag(&self) -> bool { self.value.is_none() } @@ -1098,52 +1098,52 @@ mod tests { let a = WidgetId::from_str("a:root/a/b/c").unwrap(); let b = WidgetId::from_str("b:root/a/b/c").unwrap(); assert_eq!(a.distance_to(&b), Ok(0)); - assert_eq!(a.is_subset_of(&b), false); - assert_eq!(a.is_superset_of(&b), false); + assert!(!a.is_subset_of(&b)); + assert!(!a.is_superset_of(&b)); let a = WidgetId::from_str("a:root/a/b").unwrap(); let b = WidgetId::from_str("b:root/a/b/c").unwrap(); assert_eq!(a.distance_to(&b), Ok(-1)); - assert_eq!(a.is_subset_of(&b), true); - assert_eq!(a.is_superset_of(&b), false); + assert!(a.is_subset_of(&b)); + assert!(!a.is_superset_of(&b)); let a = WidgetId::from_str("a:root/a").unwrap(); let b = WidgetId::from_str("b:root/a/b/c").unwrap(); assert_eq!(a.distance_to(&b), Ok(-2)); - assert_eq!(a.is_subset_of(&b), true); - assert_eq!(a.is_superset_of(&b), false); + assert!(a.is_subset_of(&b)); + assert!(!a.is_superset_of(&b)); let a = WidgetId::from_str("a:root").unwrap(); let b = WidgetId::from_str("b:root/a/b/c").unwrap(); assert_eq!(a.distance_to(&b), Ok(-3)); - assert_eq!(a.is_subset_of(&b), true); - assert_eq!(a.is_superset_of(&b), false); + assert!(a.is_subset_of(&b)); + assert!(!a.is_superset_of(&b)); let a = WidgetId::from_str("a:root/a/b/c").unwrap(); let b = WidgetId::from_str("b:root/a/b").unwrap(); assert_eq!(a.distance_to(&b), Ok(1)); - assert_eq!(a.is_subset_of(&b), false); - assert_eq!(a.is_superset_of(&b), true); + assert!(!a.is_subset_of(&b)); + assert!(a.is_superset_of(&b)); let a = WidgetId::from_str("a:root/a/b/c").unwrap(); let b = WidgetId::from_str("b:root/a").unwrap(); assert_eq!(a.distance_to(&b), Ok(2)); - assert_eq!(a.is_subset_of(&b), false); - assert_eq!(a.is_superset_of(&b), true); + assert!(!a.is_subset_of(&b)); + assert!(a.is_superset_of(&b)); let a = WidgetId::from_str("a:root/a/b/c").unwrap(); let b = WidgetId::from_str("b:root").unwrap(); assert_eq!(a.distance_to(&b), Ok(3)); - assert_eq!(a.is_subset_of(&b), false); - assert_eq!(a.is_superset_of(&b), true); + assert!(!a.is_subset_of(&b)); + assert!(a.is_superset_of(&b)); let a = WidgetId::from_str("a:root/a/b/x").unwrap(); let b = WidgetId::from_str("b:root/a/b/c").unwrap(); assert_eq!(a.distance_to(&b), Err(-1)); - assert_eq!(a.is_subset_of(&b), false); - assert_eq!(a.is_superset_of(&b), false); + assert!(!a.is_subset_of(&b)); + assert!(!a.is_superset_of(&b)); let a = WidgetId::from_str("a:root/a/x/y").unwrap(); let b = WidgetId::from_str("b:root/a/b/c").unwrap(); assert_eq!(a.distance_to(&b), Err(-2)); - assert_eq!(a.is_subset_of(&b), false); - assert_eq!(a.is_superset_of(&b), false); + assert!(!a.is_subset_of(&b)); + assert!(!a.is_superset_of(&b)); let a = WidgetId::from_str("a:root/x/y/z").unwrap(); let b = WidgetId::from_str("b:root/a/b/c").unwrap(); assert_eq!(a.distance_to(&b), Err(-3)); - assert_eq!(a.is_subset_of(&b), false); - assert_eq!(a.is_superset_of(&b), false); + assert!(!a.is_subset_of(&b)); + assert!(!a.is_superset_of(&b)); } } diff --git a/raui-derive/Cargo.toml b/raui-derive/Cargo.toml index 58e9cc9..41badb9 100644 --- a/raui-derive/Cargo.toml +++ b/raui-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raui-derive" -version = "0.64.0" +version = "0.64.1" authors = ["Patryk 'PsichiX' Budzynski "] edition = "2021" description = "Macros for Renderer Agnostic User Interface" diff --git a/raui-immediate-widgets/Cargo.toml b/raui-immediate-widgets/Cargo.toml index f400679..67a4ff4 100644 --- a/raui-immediate-widgets/Cargo.toml +++ b/raui-immediate-widgets/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raui-immediate-widgets" -version = "0.64.0" +version = "0.64.1" authors = ["Patryk 'PsichiX' Budzynski "] edition = "2021" description = "Widgets library for RAUI immediate mode UI layer" diff --git a/raui-immediate/Cargo.toml b/raui-immediate/Cargo.toml index 5467390..614ce10 100644 --- a/raui-immediate/Cargo.toml +++ b/raui-immediate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raui-immediate" -version = "0.64.0" +version = "0.64.1" authors = ["Patryk 'PsichiX' Budzynski "] edition = "2021" description = "RAUI immediate mode UI layer" diff --git a/raui-immediate/src/lib.rs b/raui-immediate/src/lib.rs index 913db69..b2fd201 100644 --- a/raui-immediate/src/lib.rs +++ b/raui-immediate/src/lib.rs @@ -487,7 +487,7 @@ mod tests { } fn text_field() { - let text = use_state(|| String::default()); + let text = use_state(String::default); let mut text = text.write().unwrap(); text.push('z'); diff --git a/raui-json-renderer/Cargo.toml b/raui-json-renderer/Cargo.toml index da0ef57..c49ad29 100644 --- a/raui-json-renderer/Cargo.toml +++ b/raui-json-renderer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raui-json-renderer" -version = "0.64.0" +version = "0.64.1" authors = ["Patryk 'PsichiX' Budzynski "] edition = "2021" description = "RAUI renderer for JSON format" diff --git a/raui-material/Cargo.toml b/raui-material/Cargo.toml index b7ee080..3b06172 100644 --- a/raui-material/Cargo.toml +++ b/raui-material/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raui-material" -version = "0.64.0" +version = "0.64.1" authors = ["Patryk 'PsichiX' Budzynski "] edition = "2021" description = "Material components library for RAUI" diff --git a/raui-retained/Cargo.toml b/raui-retained/Cargo.toml index a51429b..72665c9 100644 --- a/raui-retained/Cargo.toml +++ b/raui-retained/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raui-retained" -version = "0.64.0" +version = "0.64.1" authors = ["Patryk 'PsichiX' Budzynski "] edition = "2021" description = "RAUI retained mode UI layer" diff --git a/raui-tesselate-renderer/Cargo.toml b/raui-tesselate-renderer/Cargo.toml index 1c95911..9356ae6 100644 --- a/raui-tesselate-renderer/Cargo.toml +++ b/raui-tesselate-renderer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raui-tesselate-renderer" -version = "0.64.0" +version = "0.64.1" authors = ["Patryk 'PsichiX' Budzynski "] edition = "2021" description = "RAUI renderer that tesselates layout into vertex and index buffers" diff --git a/raui-tesselate-renderer/src/lib.rs b/raui-tesselate-renderer/src/lib.rs index 361fc0b..1c8a73d 100644 --- a/raui-tesselate-renderer/src/lib.rs +++ b/raui-tesselate-renderer/src/lib.rs @@ -730,7 +730,7 @@ where } } -impl<'a, V, B, P, C> Renderer<(), Error> for TesselateRenderer<'a, V, B, P, C> +impl Renderer<(), Error> for TesselateRenderer<'_, V, B, P, C> where V: TesselateVertex + TextVertex + Default, B: PartialEq,