From 21da3f95b00431f4d10d8b5e67ee402bffde129c Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Tue, 11 May 2021 22:51:38 -0400 Subject: Rust API; More setting support, fix edgecase in open_view_with_options, and fixed using mut for const correctness (mut != ~const) --- rust/src/string.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rust/src/string.rs') 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 { -- cgit v1.3.1