[gnome-tour/wip/cdavis/clean-warnings] general: Clean up warnings




commit cd0ab93ce8feb17801e0d8501b4b8005553ca4aa
Author: Christopher Davis <christopherdavis gnome org>
Date:   Thu Dec 9 23:35:50 2021 -0800

    general: Clean up warnings
    
    We've had a few warnings sticking around for unused pieces
    of code, or things that needed some form of error handling.

 src/application.rs    |  1 -
 src/main.rs           | 10 ++++++++--
 src/widgets/window.rs |  3 ---
 3 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/application.rs b/src/application.rs
index c0f2451..ba9ea12 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -1,7 +1,6 @@
 use crate::config;
 use crate::utils;
 use crate::widgets::Window;
-use gtk::gdk;
 use gtk::gio::{self, prelude::*};
 use gtk::glib::{self, clone};
 use gtk::prelude::*;
diff --git a/src/main.rs b/src/main.rs
index 605bd7e..dbc9b75 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -14,8 +14,14 @@ fn main() {
     pretty_env_logger::init();
     // Prepare i18n
     setlocale(LocaleCategory::LcAll, "");
-    bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
-    textdomain(GETTEXT_PACKAGE);
+    bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR).expect(&format!(
+        "Unable to bind text domain for {}",
+        GETTEXT_PACKAGE
+    ));
+    textdomain(GETTEXT_PACKAGE).expect(&format!(
+        "Unable to switch to text domain {}",
+        GETTEXT_PACKAGE
+    ));
 
     glib::set_application_name(&gettext("Tour"));
     glib::set_prgname(Some("Tour"));
diff --git a/src/widgets/window.rs b/src/widgets/window.rs
index 9443569..483c6ff 100644
--- a/src/widgets/window.rs
+++ b/src/widgets/window.rs
@@ -1,4 +1,3 @@
-use crate::utils::i18n_f;
 use gettextrs::gettext;
 use gtk::glib;
 use gtk::prelude::*;
@@ -96,8 +95,6 @@ impl Window {
             .upcast::<gtk::Widget>(),
         );
 
-        let name = glib::os_info("NAME").unwrap_or_else(|| "GNOME".into());
-        let version = glib::os_info("VERSION").unwrap_or_else(|| "".into());
         let last_page = ImagePageWidget::new(
             "/org/gnome/Tour/ready-to-go.svg",
             gettext("That's it. Have a nice day!"),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]