[gnome-builder] plugins/meson-templates/rust: avoid warnings by default



commit f3edc8f5214ccd1b81daabfb8aedf35a380d1291
Author: Marco Melorio <marco melorio protonmail com>
Date:   Sun Aug 28 17:55:42 2022 +0200

    plugins/meson-templates/rust: avoid warnings by default
    
    The Rust Gnome Application template had a warning about unused
    `gtk::subclass::prelude::*` use declaration. This commit fixes that.

 src/plugins/meson-templates/resources/src/application-gtk4.rs | 5 +++--
 src/plugins/meson-templates/resources/src/window-gtk4.rs      | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/meson-templates/resources/src/application-gtk4.rs 
b/src/plugins/meson-templates/resources/src/application-gtk4.rs
index 6bad3c8de..b52f4b01c 100644
--- a/src/plugins/meson-templates/resources/src/application-gtk4.rs
+++ b/src/plugins/meson-templates/resources/src/application-gtk4.rs
@@ -2,11 +2,12 @@
 
 use glib::clone;
 use gtk::prelude::*;
-use gtk::subclass::prelude::*;
-use gtk::{gio, glib};
 {{if is_adwaita}}
 use adw::subclass::prelude::*;
+{{else}}
+use gtk::subclass::prelude::*;
 {{end}}
+use gtk::{gio, glib};
 
 use crate::config::VERSION;
 use crate::{{PreFix}}Window;
diff --git a/src/plugins/meson-templates/resources/src/window-gtk4.rs 
b/src/plugins/meson-templates/resources/src/window-gtk4.rs
index 23732815a..783e14cd5 100644
--- a/src/plugins/meson-templates/resources/src/window-gtk4.rs
+++ b/src/plugins/meson-templates/resources/src/window-gtk4.rs
@@ -1,10 +1,11 @@
 {{include "license.rs"}}
 
+use gtk::prelude::*;
 {{if is_adwaita}}
 use adw::subclass::prelude::*;
-{{end}}
-use gtk::prelude::*;
+{{else}}
 use gtk::subclass::prelude::*;
+{{end}}
 use gtk::{gio, glib, CompositeTemplate};
 
 mod imp {


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