Skip to content

Commit e44e65b

Browse files
committed
glib: Implement From<&String> for GString
1 parent b67a499 commit e44e65b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

glib/src/gstring.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,13 @@ impl From<&str> for GString {
14611461
}
14621462
}
14631463

1464+
impl From<&String> for GString {
1465+
#[inline]
1466+
fn from(s: &String) -> Self {
1467+
GString::from(s.as_str())
1468+
}
1469+
}
1470+
14641471
impl TryFrom<CString> for GString {
14651472
type Error = GStringUtf8Error<CString>;
14661473
#[inline]

0 commit comments

Comments
 (0)