From 1db706aa5bf2563f29b0071746a4c0d6b83f84eb Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 26 Sep 2024 00:59:44 +0300 Subject: [PATCH] follow new construction protocol --- src/browser/header/mod.rs | 5 ++--- src/browser/main/mod.rs | 7 +++---- src/browser/main/tab/label/mod.rs | 6 ++---- src/browser/main/tab/mod.rs | 13 +++++++------ src/browser/main/tab/page/content/mod.rs | 8 +++----- src/browser/main/tab/page/mod.rs | 12 ++++++------ src/browser/mod.rs | 4 ++-- 7 files changed, 25 insertions(+), 30 deletions(-) diff --git a/src/browser/header/mod.rs b/src/browser/header/mod.rs index 9c6f3f71..f8813456 100644 --- a/src/browser/header/mod.rs +++ b/src/browser/header/mod.rs @@ -5,7 +5,6 @@ use subject::Subject; use tray::Tray; use gtk::{glib::GString, HeaderBar}; -use std::sync::Arc; pub struct Header { widget: HeaderBar, @@ -14,7 +13,7 @@ pub struct Header { impl Header { // Construct - pub fn new() -> Arc
{ + pub fn new() -> Header { let tray = Tray::new(); let subject = Subject::new(); @@ -22,7 +21,7 @@ impl Header { widget.pack_start(tray.widget()); widget.set_title_widget(Some(subject.widget())); - Arc::new(Self { widget, subject }) + Self { widget, subject } } // Actions diff --git a/src/browser/main/mod.rs b/src/browser/main/mod.rs index 07ad8df3..6ff7677c 100644 --- a/src/browser/main/mod.rs +++ b/src/browser/main/mod.rs @@ -3,16 +3,15 @@ mod tab; use tab::Tab; use gtk::{glib::GString, prelude::BoxExt, Box, Orientation}; -use std::sync::Arc; pub struct Main { - tab: Arc, + tab: Tab, widget: Box, } impl Main { // Construct - pub fn new() -> Arc
{ + pub fn new() -> Main { // Init components let tab = Tab::new(); @@ -22,7 +21,7 @@ impl Main { widget.append(tab.widget()); // Init struct - Arc::new(Self { tab, widget }) + Self { tab, widget } } // Actions diff --git a/src/browser/main/tab/label/mod.rs b/src/browser/main/tab/label/mod.rs index 7bc31997..5a8d8b52 100644 --- a/src/browser/main/tab/label/mod.rs +++ b/src/browser/main/tab/label/mod.rs @@ -10,8 +10,6 @@ use gtk::{ Align, Box, Orientation, }; -use std::sync::Arc; - pub struct Label { // Components pin: Pin, @@ -23,7 +21,7 @@ pub struct Label { impl Label { // Construct - pub fn new(name: GString, is_pinned: bool) -> Arc