main.rs
1 mod app; 2 mod profile; 3 mod tool; 4 5 use gtk::glib::ExitCode; 6 use profile::Profile; 7 8 fn main() -> ExitCode { 9 use app::App; 10 11 if let Err(e) = gtk::init() { 12 eprintln!("Failed to initialize GTK: {e}"); 13 return ExitCode::FAILURE; 14 } 15 16 match Profile::init() { 17 Ok(profile) => match App::build(profile) { 18 Ok(app) => match app.run() { 19 Ok(run) => return run, 20 Err(e) => eprintln!("Failed to run application: {e}"), 21 }, 22 Err(e) => eprintln!("Failed to build application: {e}"), 23 }, 24 Err(e) => eprintln!("Failed to initialize profile: {e}"), 25 } 26 27 ExitCode::FAILURE 28 }