[gnome-tour] paginator: Use derive Default instead



commit 5cd50eed12f67693c6e30e55f816e5db1d9506ed
Author: Bilal Elmoussaoui <belmouss redhat com>
Date:   Tue Sep 20 14:06:13 2022 +0200

    paginator: Use derive Default instead

 src/widgets/paginator.rs | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
---
diff --git a/src/widgets/paginator.rs b/src/widgets/paginator.rs
index 2feabe4..f8be161 100644
--- a/src/widgets/paginator.rs
+++ b/src/widgets/paginator.rs
@@ -9,7 +9,7 @@ mod imp {
     use super::*;
     use std::cell::{Cell, RefCell};
 
-    #[derive(Debug, gtk::CompositeTemplate)]
+    #[derive(Default, Debug, gtk::CompositeTemplate)]
     #[template(resource = "/org/gnome/Tour/ui/paginator.ui")]
     pub struct PaginatorWidget {
         #[template_child]
@@ -25,20 +25,6 @@ mod imp {
         pub(super) going_backward: Cell<bool>,
     }
 
-    impl Default for PaginatorWidget {
-        fn default() -> Self {
-            Self {
-                carousel: TemplateChild::default(),
-                start_btn: TemplateChild::default(),
-                next_btn: TemplateChild::default(),
-                previous_btn: TemplateChild::default(),
-                pages: RefCell::default(),
-                current_page: Cell::new(0),
-                going_backward: Cell::new(false),
-            }
-        }
-    }
-
     #[glib::object_subclass]
     impl ObjectSubclass for PaginatorWidget {
         const NAME: &'static str = "PaginatorWidget";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]