From 6da3b9802f18d1b934768b9e67dd8fa1d31571be Mon Sep 17 00:00:00 2001 From: Jason Francis Date: Fri, 11 Mar 2022 08:41:35 -0500 Subject: [PATCH] glib: Have GString deref to GStr --- gio/src/dbus_proxy.rs | 4 ++-- glib/src/gstring.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gio/src/dbus_proxy.rs b/gio/src/dbus_proxy.rs index 44e9417e1514..ca868d058930 100644 --- a/gio/src/dbus_proxy.rs +++ b/gio/src/dbus_proxy.rs @@ -45,9 +45,9 @@ impl> DBusProxyExtManual for O { let f: &F = &*(f as *const F); f( DBusProxy::from_glib_borrow(this).unsafe_cast_ref(), - Option::::from_glib_borrow(sender_name) + (*Option::::from_glib_borrow(sender_name)) .as_ref() - .as_deref(), + .map(|s| s.as_str()), &glib::GString::from_glib_borrow(signal_name), &from_glib_borrow(parameters), ) diff --git a/glib/src/gstring.rs b/glib/src/gstring.rs index 95d436729e5e..651f78adda60 100644 --- a/glib/src/gstring.rs +++ b/glib/src/gstring.rs @@ -617,10 +617,10 @@ impl AsRef<[u8]> for GString { } impl Deref for GString { - type Target = str; + type Target = GStr; - fn deref(&self) -> &str { - self.as_str() + fn deref(&self) -> &GStr { + self.as_gstr() } }