diff options
| author | Rubens Brandao <git@rubens.io> | 2024-05-24 09:50:59 -0300 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2024-07-26 18:38:42 -0400 |
| commit | 361574240fff979a76adaccaf9809f21a1f6ab12 (patch) | |
| tree | 2b96055ad6ec2141189d53e219299157fa4e5e87 /rust/src/string.rs | |
| parent | 031456e41d4b1bc5a185934fb7a0a506618d3a8d (diff) | |
Finish the `DataBuffer` implementation
Diffstat (limited to 'rust/src/string.rs')
| -rw-r--r-- | rust/src/string.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rust/src/string.rs b/rust/src/string.rs index 936e3033..bfb998d5 100644 --- a/rust/src/string.rs +++ b/rust/src/string.rs @@ -79,6 +79,10 @@ impl BnString { res } + pub(crate) fn as_raw(&self) -> &raw::c_char { + unsafe { &*self.raw } + } + pub fn as_str(&self) -> &str { unsafe { CStr::from_ptr(self.raw).to_str().unwrap() } } |
