From 003486e3edaf5c4e65fe34bc3eb0cf299a6c6cf7 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 26 Sep 2024 01:14:33 +0300 Subject: [PATCH] return Self implementation --- src/browser/header/mod.rs | 2 +- src/browser/header/subject/description/mod.rs | 2 +- src/browser/header/subject/mod.rs | 2 +- src/browser/header/subject/title/mod.rs | 2 +- src/browser/header/tray/menu/mod.rs | 2 +- src/browser/header/tray/mod.rs | 2 +- src/browser/header/tray/tab/mod.rs | 2 +- src/browser/main/mod.rs | 2 +- src/browser/main/tab/label/title/mod.rs | 2 +- src/browser/main/tab/page/content/mod.rs | 2 +- src/browser/main/tab/page/content/text/gemini/reader/mod.rs | 2 +- src/browser/main/tab/page/content/text/mod.rs | 2 +- src/browser/main/tab/page/content/text/plain/reader/mod.rs | 2 +- src/browser/main/tab/page/meta.rs | 2 +- src/browser/main/tab/page/navigation/base/mod.rs | 2 +- src/browser/main/tab/page/navigation/bookmark/mod.rs | 2 +- src/browser/main/tab/page/navigation/history/back/mod.rs | 2 +- src/browser/main/tab/page/navigation/history/forward/mod.rs | 2 +- src/browser/main/tab/page/navigation/history/mod.rs | 2 +- src/browser/main/tab/page/navigation/mod.rs | 2 +- src/browser/main/tab/page/navigation/reload/mod.rs | 2 +- src/browser/main/tab/page/navigation/request/mod.rs | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/browser/header/mod.rs b/src/browser/header/mod.rs index f8813456..4f0bfbe0 100644 --- a/src/browser/header/mod.rs +++ b/src/browser/header/mod.rs @@ -13,7 +13,7 @@ pub struct Header { impl Header { // Construct - pub fn new() -> Header { + pub fn new() -> Self { let tray = Tray::new(); let subject = Subject::new(); diff --git a/src/browser/header/subject/description/mod.rs b/src/browser/header/subject/description/mod.rs index 6d32938e..5b48e6eb 100644 --- a/src/browser/header/subject/description/mod.rs +++ b/src/browser/header/subject/description/mod.rs @@ -7,7 +7,7 @@ pub struct Description { impl Description { // Construct - pub fn new() -> Description { + pub fn new() -> Self { let widget = Label::builder() .css_classes(["subtitle"]) .single_line_mode(true) diff --git a/src/browser/header/subject/mod.rs b/src/browser/header/subject/mod.rs index ae7215dd..164b70cb 100644 --- a/src/browser/header/subject/mod.rs +++ b/src/browser/header/subject/mod.rs @@ -14,7 +14,7 @@ pub struct Subject { impl Subject { // Construct - pub fn new() -> Subject { + pub fn new() -> Self { let title = Title::new(); let description = Description::new(); diff --git a/src/browser/header/subject/title/mod.rs b/src/browser/header/subject/title/mod.rs index 53519a2b..fece2e0d 100644 --- a/src/browser/header/subject/title/mod.rs +++ b/src/browser/header/subject/title/mod.rs @@ -8,7 +8,7 @@ pub struct Title { impl Title { // Construct - pub fn new() -> Title { + pub fn new() -> Self { let widget = gtk::Label::builder() .css_classes(["title"]) .single_line_mode(true) diff --git a/src/browser/header/tray/menu/mod.rs b/src/browser/header/tray/menu/mod.rs index bd10b0d1..c5bae60e 100644 --- a/src/browser/header/tray/menu/mod.rs +++ b/src/browser/header/tray/menu/mod.rs @@ -5,7 +5,7 @@ pub struct Menu { } impl Menu { - pub fn new() -> Menu { + pub fn new() -> Self { // Init model let model_tab = gio::Menu::new(); model_tab.append(Some("New"), Some("win.tab_append")); diff --git a/src/browser/header/tray/mod.rs b/src/browser/header/tray/mod.rs index 551c4397..3907786e 100644 --- a/src/browser/header/tray/mod.rs +++ b/src/browser/header/tray/mod.rs @@ -11,7 +11,7 @@ pub struct Tray { } impl Tray { - pub fn new() -> Tray { + pub fn new() -> Self { let menu = Menu::new(); let tab = Tab::new(); diff --git a/src/browser/header/tray/tab/mod.rs b/src/browser/header/tray/tab/mod.rs index ee7cd741..787c58fe 100644 --- a/src/browser/header/tray/tab/mod.rs +++ b/src/browser/header/tray/tab/mod.rs @@ -6,7 +6,7 @@ pub struct Tab { impl Tab { // Construct - pub fn new() -> Tab { + pub fn new() -> Self { Self { widget: Button::builder() .action_name("win.tab_append") diff --git a/src/browser/main/mod.rs b/src/browser/main/mod.rs index e989f56e..eafd11c7 100644 --- a/src/browser/main/mod.rs +++ b/src/browser/main/mod.rs @@ -13,7 +13,7 @@ pub struct Main { impl Main { // Construct - pub fn new() -> Main { + pub fn new() -> Self { // Init components let tab = Arc::new(Tab::new()); diff --git a/src/browser/main/tab/label/title/mod.rs b/src/browser/main/tab/label/title/mod.rs index 79b493ac..84565bee 100644 --- a/src/browser/main/tab/label/title/mod.rs +++ b/src/browser/main/tab/label/title/mod.rs @@ -6,7 +6,7 @@ pub struct Title { impl Title { // Construct - pub fn new() -> Title { + pub fn new() -> Self { Self { widget: Label::builder() .label("New page") diff --git a/src/browser/main/tab/page/content/mod.rs b/src/browser/main/tab/page/content/mod.rs index 33f818c7..81dc018c 100644 --- a/src/browser/main/tab/page/content/mod.rs +++ b/src/browser/main/tab/page/content/mod.rs @@ -6,7 +6,7 @@ pub struct Content { impl Content { // Construct - pub fn new() -> Content { + pub fn new() -> Self { Self { widget: Box::builder().orientation(Orientation::Vertical).build(), } diff --git a/src/browser/main/tab/page/content/text/gemini/reader/mod.rs b/src/browser/main/tab/page/content/text/gemini/reader/mod.rs index 063975f2..572aa23b 100644 --- a/src/browser/main/tab/page/content/text/gemini/reader/mod.rs +++ b/src/browser/main/tab/page/content/text/gemini/reader/mod.rs @@ -6,7 +6,7 @@ pub struct Reader { impl Reader { // Construct - pub fn new() -> Reader { + pub fn new() -> Self { Self { widget: Label::builder() .halign(Align::Start) diff --git a/src/browser/main/tab/page/content/text/mod.rs b/src/browser/main/tab/page/content/text/mod.rs index 6a2e0897..a7630ae7 100644 --- a/src/browser/main/tab/page/content/text/mod.rs +++ b/src/browser/main/tab/page/content/text/mod.rs @@ -6,7 +6,7 @@ pub struct Text { impl Text { // Construct - pub fn new() -> Text { + pub fn new() -> Self { Self { widget: ScrolledWindow::builder().build(), } diff --git a/src/browser/main/tab/page/content/text/plain/reader/mod.rs b/src/browser/main/tab/page/content/text/plain/reader/mod.rs index 063975f2..572aa23b 100644 --- a/src/browser/main/tab/page/content/text/plain/reader/mod.rs +++ b/src/browser/main/tab/page/content/text/plain/reader/mod.rs @@ -6,7 +6,7 @@ pub struct Reader { impl Reader { // Construct - pub fn new() -> Reader { + pub fn new() -> Self { Self { widget: Label::builder() .halign(Align::Start) diff --git a/src/browser/main/tab/page/meta.rs b/src/browser/main/tab/page/meta.rs index 819925dc..0095a014 100644 --- a/src/browser/main/tab/page/meta.rs +++ b/src/browser/main/tab/page/meta.rs @@ -14,7 +14,7 @@ pub struct Meta { } impl Meta { - pub fn new() -> Meta { + pub fn new() -> Self { Self { title: GString::new(), description: GString::new(), diff --git a/src/browser/main/tab/page/navigation/base/mod.rs b/src/browser/main/tab/page/navigation/base/mod.rs index 5c09f322..ba65c648 100644 --- a/src/browser/main/tab/page/navigation/base/mod.rs +++ b/src/browser/main/tab/page/navigation/base/mod.rs @@ -6,7 +6,7 @@ pub struct Base { impl Base { // Construct - pub fn new() -> Base { + pub fn new() -> Self { Self { widget: Button::builder() .action_name("win.tab_page_base") diff --git a/src/browser/main/tab/page/navigation/bookmark/mod.rs b/src/browser/main/tab/page/navigation/bookmark/mod.rs index 425508ee..a069ba5f 100644 --- a/src/browser/main/tab/page/navigation/bookmark/mod.rs +++ b/src/browser/main/tab/page/navigation/bookmark/mod.rs @@ -6,7 +6,7 @@ pub struct Bookmark { impl Bookmark { // Construct - pub fn new() -> Bookmark { + pub fn new() -> Self { Self { widget: Button::builder() .action_name("win.tab_page_bookmark") diff --git a/src/browser/main/tab/page/navigation/history/back/mod.rs b/src/browser/main/tab/page/navigation/history/back/mod.rs index 4c4bd219..40b20389 100644 --- a/src/browser/main/tab/page/navigation/history/back/mod.rs +++ b/src/browser/main/tab/page/navigation/history/back/mod.rs @@ -6,7 +6,7 @@ pub struct Back { impl Back { // Construct - pub fn new() -> Back { + pub fn new() -> Self { Self { widget: Button::builder() .action_name("win.tab_page_history_back") diff --git a/src/browser/main/tab/page/navigation/history/forward/mod.rs b/src/browser/main/tab/page/navigation/history/forward/mod.rs index 57ea7c3b..da42d3e0 100644 --- a/src/browser/main/tab/page/navigation/history/forward/mod.rs +++ b/src/browser/main/tab/page/navigation/history/forward/mod.rs @@ -6,7 +6,7 @@ pub struct Forward { impl Forward { // Construct - pub fn new() -> Forward { + pub fn new() -> Self { Self { widget: Button::builder() .action_name("win.tab_page_history_forward") diff --git a/src/browser/main/tab/page/navigation/history/mod.rs b/src/browser/main/tab/page/navigation/history/mod.rs index f1f7e9e9..7054376a 100644 --- a/src/browser/main/tab/page/navigation/history/mod.rs +++ b/src/browser/main/tab/page/navigation/history/mod.rs @@ -14,7 +14,7 @@ pub struct History { impl History { // Construct - pub fn new() -> History { + pub fn new() -> Self { // init components let back = Back::new(); let forward = Forward::new(); diff --git a/src/browser/main/tab/page/navigation/mod.rs b/src/browser/main/tab/page/navigation/mod.rs index 5869f0be..92af32af 100644 --- a/src/browser/main/tab/page/navigation/mod.rs +++ b/src/browser/main/tab/page/navigation/mod.rs @@ -24,7 +24,7 @@ pub struct Navigation { } impl Navigation { - pub fn new() -> Navigation { + pub fn new() -> Self { // Init components let base = Base::new(); let history = History::new(); diff --git a/src/browser/main/tab/page/navigation/reload/mod.rs b/src/browser/main/tab/page/navigation/reload/mod.rs index f9ad5c50..392e9055 100644 --- a/src/browser/main/tab/page/navigation/reload/mod.rs +++ b/src/browser/main/tab/page/navigation/reload/mod.rs @@ -6,7 +6,7 @@ pub struct Reload { impl Reload { // Construct - pub fn new() -> Reload { + pub fn new() -> Self { Self { widget: Button::builder() .action_name("win.tab_page_reload") diff --git a/src/browser/main/tab/page/navigation/request/mod.rs b/src/browser/main/tab/page/navigation/request/mod.rs index 42b34f5d..e25a47ea 100644 --- a/src/browser/main/tab/page/navigation/request/mod.rs +++ b/src/browser/main/tab/page/navigation/request/mod.rs @@ -10,7 +10,7 @@ pub struct Request { impl Request { // Construct - pub fn new() -> Request { + pub fn new() -> Self { // GTK let widget = Entry::builder() .placeholder_text("URL or search term...")