From 5d6fbb6f04e139220b168c91dea4251cb703a499 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Wed, 27 Jun 2018 18:20:45 +0300 Subject: [PATCH] Headerbar: ::new() method now returns Rc. --- hammond-gtk/src/app.rs | 2 +- hammond-gtk/src/headerbar.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hammond-gtk/src/app.rs b/hammond-gtk/src/app.rs index a4b922a..3b3a354 100644 --- a/hammond-gtk/src/app.rs +++ b/hammond-gtk/src/app.rs @@ -88,7 +88,7 @@ impl App { let content = Content::new(&sender).expect("Content Initialization failed."); // Create the headerbar - let header = Rc::new(Header::new(&content, &window, &sender)); + let header = Header::new(&content, &window, &sender); // Add the content main stack to the overlay. let overlay = gtk::Overlay::new(); diff --git a/hammond-gtk/src/headerbar.rs b/hammond-gtk/src/headerbar.rs index 0b0c4ce..9e0d7fd 100644 --- a/hammond-gtk/src/headerbar.rs +++ b/hammond-gtk/src/headerbar.rs @@ -14,6 +14,8 @@ use app::Action; use stacks::Content; use utils::{itunes_to_rss, refresh}; +use std::rc::Rc; + #[derive(Debug, Clone)] // TODO: split this into smaller pub struct Header { @@ -60,14 +62,14 @@ impl Default for Header { } } -// TODO: Refactor components into smaller state machines +// TODO: Refactor components into smaller widgets. impl Header { pub fn new( content: &Content, window: >k::ApplicationWindow, sender: &Sender, - ) -> Header { - let h = Header::default(); + ) -> Rc { + let h = Rc::new(Header::default()); h.init(content, window, &sender); h }