From 13751e3708c93f8ac997f1ee64939f48b0fea201 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 28 Nov 2017 10:27:43 +0200 Subject: [PATCH] Tweak gresource initialization. --- hammond-gtk/src/static_resource.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hammond-gtk/src/static_resource.rs b/hammond-gtk/src/static_resource.rs index e7e1eba..b48c444 100644 --- a/hammond-gtk/src/static_resource.rs +++ b/hammond-gtk/src/static_resource.rs @@ -6,11 +6,8 @@ pub fn init() -> Result<(), Error> { let res_bytes = include_bytes!("../resources/resources.gresource"); // Create Resource it will live as long the value lives. - // TODO: change it into Bytes::From_static once the fix lands - // https://bugzilla.gnome.org/show_bug.cgi?id=790030 - let gbytes = Bytes::from(&res_bytes.as_ref()); + let gbytes = Bytes::from_static(res_bytes.as_ref()); let resource = Resource::new_from_data(&gbytes)?; - // let resource = Resource::new_from_data(&res_bytes.as_ref().into())?; // Register the resource so It wont be dropped and will continue to live in memory. resources_register(&resource);