diff --git a/src/app.rs b/src/app.rs index 2941a86e..1c1a50d4 100644 --- a/src/app.rs +++ b/src/app.rs @@ -23,14 +23,15 @@ impl App { // Constructors /// Build new `Self` - pub fn build(profile: &Rc) -> Self { + pub fn build(profile: Profile) -> Self { // Init GTK let application = Application::builder() .application_id(APPLICATION_ID) .build(); // Init components - let browser = Rc::new(Browser::build(profile)); + let profile = Rc::new(profile); + let browser = Rc::new(Browser::build(&profile)); // Prevent startup warning @TODO application.connect_activate(|_| {}); diff --git a/src/main.rs b/src/main.rs index 03926106..4f95bb08 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,6 @@ use profile::Profile; fn main() -> ExitCode { use app::App; - use std::rc::Rc; if let Err(e) = gtk::init() { eprintln!("Failed to initialize GTK: {e}"); @@ -15,7 +14,7 @@ fn main() -> ExitCode { } match Profile::init() { - Ok(profile) => match App::build(&Rc::new(profile)).run() { + Ok(profile) => match App::build(profile).run() { Ok(app) => return app, Err(e) => eprintln!("Failed to initialize application: {e}"), },