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.
From<&GStr>
From<GString>
Cow<GStr>
1 parent 248aae9 commit 279b352Copy full SHA for 279b352
glib/src/gstring.rs
@@ -4,7 +4,7 @@ use crate::translate::*;
4
use crate::types::{StaticType, Type};
5
use crate::value::{FromValue, ToValue};
6
use crate::Value;
7
-use std::borrow::Borrow;
+use std::borrow::{Borrow, Cow};
8
use std::cmp::Ordering;
9
use std::ffi::{CStr, CString, OsStr};
10
use std::fmt;
@@ -742,6 +742,18 @@ impl From<&CStr> for GString {
742
}
743
744
745
+impl<'a> From<GString> for Cow<'a, GStr> {
746
+ fn from(v: GString) -> Self {
747
+ Cow::Owned(v)
748
+ }
749
+}
750
+
751
+impl<'a> From<&'a GStr> for Cow<'a, GStr> {
752
+ fn from(v: &'a GStr) -> Self {
753
+ Cow::Borrowed(v)
754
755
756
757
#[doc(hidden)]
758
impl FromGlibPtrFull<*mut u8> for GString {
759
#[inline]
0 commit comments