Allow pushing arbitrary bytes to CxxString
diff --git a/src/cxx_string.rs b/src/cxx_string.rs
index dd53adc..5010175 100644
--- a/src/cxx_string.rs
+++ b/src/cxx_string.rs
@@ -87,7 +87,12 @@
/// Appends a given string slice onto the end of this C++ string.
pub fn push_str(&mut self, s: &str) {
- unsafe { string_push(self, s.as_ptr(), s.len()) }
+ self.push_bytes(s.as_bytes());
+ }
+
+ /// Appends arbitrary bytes onto the end of this C++ string.
+ pub fn push_bytes(&mut self, bytes: &[u8]) {
+ unsafe { string_push(self, bytes.as_ptr(), bytes.len()) }
}
}