Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
basic_subclass: remove useless code
Browse files Browse the repository at this point in the history
We already have access to the private part of the object.
  • Loading branch information
alatiera committed Apr 26, 2020
1 parent 0ef8a6e commit 6dcd9c9
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/bin/basic_subclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,8 @@ impl ApplicationImpl for SimpleApplicationPrivate {
// `gio::Application::activate` is what gets called when the
// application is launched by the desktop environment and
// aksed to present itself.
fn activate(&self, app: &gio::Application) {
let app = app.downcast_ref::<gtk::Application>().unwrap();
let priv_ = SimpleApplicationPrivate::from_instance(app);
let window = priv_
fn activate(&self, _app: &gio::Application) {
let window = self
.window
.get()
.expect("Should always be initiliazed in gio_application_startup");
Expand All @@ -187,10 +185,8 @@ impl ApplicationImpl for SimpleApplicationPrivate {
self.parent_startup(app);

let app = app.downcast_ref::<gtk::Application>().unwrap();
let priv_ = SimpleApplicationPrivate::from_instance(app);
let window = SimpleWindow::new(&app);
priv_
.window
self.window
.set(window)
.expect("Failed to initialize application window");
}
Expand Down

0 comments on commit 6dcd9c9

Please sign in to comment.