diff options
| author | Mason Reed <mason@vector35.com> | 2025-02-25 13:06:19 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-02-25 13:06:19 -0500 |
| commit | f4dd84641f5499abee06570e65272698c05a7fb6 (patch) | |
| tree | 60ae6f65aa7d824297651205f73d9673d4a6f4a8 /rust/src/string.rs | |
| parent | 7d70a1596686479cca73aa983e3adcc1ca4c089d (diff) | |
Fix BnString usage of `as_ref` instead of `as_str`
Fixes `BnString::len` and `BnString::is_empty` incorrectly reporting 1 and true on empty null terminated string.
Diffstat (limited to 'rust/src/string.rs')
| -rw-r--r-- | rust/src/string.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/src/string.rs b/rust/src/string.rs index c0d6daba..3bda6a81 100644 --- a/rust/src/string.rs +++ b/rust/src/string.rs @@ -101,11 +101,11 @@ impl BnString { } pub fn len(&self) -> usize { - self.as_ref().len() + self.as_str().len() } pub fn is_empty(&self) -> bool { - self.as_ref().is_empty() + self.as_str().is_empty() } } |
