diff --git a/core-foundation/src/string.rs b/core-foundation/src/string.rs index 0415ecd..5026b71 100644 --- a/core-foundation/src/string.rs +++ b/core-foundation/src/string.rs @@ -43,6 +43,13 @@ impl FromStr for CFString { } } +impl<'a> From<&'a str> for CFString { + #[inline] + fn from(string: &'a str) -> CFString { + CFString::new(string) + } +} + impl fmt::Display for CFString { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { unsafe {