summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipc/src/sexp.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/ipc/src/sexp.rs b/ipc/src/sexp.rs
index 7a8ce18c..69c9e151 100644
--- a/ipc/src/sexp.rs
+++ b/ipc/src/sexp.rs
@@ -414,12 +414,24 @@ impl Drop for String_ {
}
}
+impl From<std::string::String> for String_ {
+ fn from(b: std::string::String) -> Self {
+ Self::new(b.into_bytes())
+ }
+}
+
impl From<&str> for String_ {
fn from(b: &str) -> Self {
Self::new(b.as_bytes().to_vec())
}
}
+impl From<Vec<u8>> for String_ {
+ fn from(b: Vec<u8>) -> Self {
+ Self::new(b.into_boxed_slice())
+ }
+}
+
impl From<&[u8]> for String_ {
fn from(b: &[u8]) -> Self {
Self::new(b.to_vec())