We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9903467 commit 94f97c2Copy full SHA for 94f97c2
glib/src/gstring.rs
@@ -1807,6 +1807,15 @@ impl From<&String> for GString {
1807
}
1808
1809
1810
+impl From<GStringPtr> for GString {
1811
+ #[inline]
1812
+ fn from(s: GStringPtr) -> Self {
1813
+ let s = mem::ManuallyDrop::new(s);
1814
+ let len = unsafe { GStr::from_ptr(s.0.as_ptr()).len() };
1815
+ GString(Inner::Foreign { ptr: s.0, len })
1816
+ }
1817
+}
1818
+
1819
impl TryFrom<CString> for GString {
1820
type Error = GStringUtf8Error<CString>;
1821
#[inline]
0 commit comments