Skip to content

Commit

Permalink
glib: Have GString deref to GStr
Browse files Browse the repository at this point in the history
  • Loading branch information
jf2048 committed Mar 11, 2022
1 parent c0f177b commit fe45283
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions gio/src/dbus_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ impl<O: IsA<DBusProxy>> DBusProxyExtManual for O {
let f: &F = &*(f as *const F);
f(
DBusProxy::from_glib_borrow(this).unsafe_cast_ref(),
Option::<glib::GString>::from_glib_borrow(sender_name)
(*Option::<glib::GString>::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),
)
Expand Down Expand Up @@ -86,9 +86,9 @@ impl<O: IsA<DBusProxy>> DBusProxyExtManual for O {
let f: &F = &*(f as *const F);
f(
DBusProxy::from_glib_borrow(this).unsafe_cast_ref(),
Option::<glib::GString>::from_glib_borrow(sender_name)
(*Option::<glib::GString>::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),
)
Expand Down
6 changes: 3 additions & 3 deletions glib/src/gstring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit fe45283

Please sign in to comment.