summaryrefslogtreecommitdiff
path: root/src/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs
index a6e279af..332cd500 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -11,6 +11,13 @@ impl ToCStr for Path {
}
}
+impl<'a> ToCStr for &'a str {
+ fn to_c_str(&self) -> CString {
+ CString::from_slice(self.as_bytes())
+ }
+}
+
+
impl ToCStr for String {
fn to_c_str(&self) -> CString {
CString::from_slice(self.as_bytes())