summaryrefslogtreecommitdiff
path: root/rust/src/string.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/string.rs')
-rw-r--r--rust/src/string.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/rust/src/string.rs b/rust/src/string.rs
index 5b20532e..e042dbdd 100644
--- a/rust/src/string.rs
+++ b/rust/src/string.rs
@@ -111,6 +111,10 @@ impl BnString {
res
}
+
+ pub fn as_str(&self) -> &str {
+ unsafe { BnStr::from_raw(self.raw).as_str() }
+ }
}
impl Drop for BnString {