asserting/c_string/
mod.rs1use crate::properties::{IsEmptyProperty, LengthProperty};
4use crate::std::ffi::{CStr, CString};
5
6impl IsEmptyProperty for CString {
7 fn is_empty_property(&self) -> bool {
8 self.is_empty()
9 }
10}
11
12impl IsEmptyProperty for &CStr {
13 fn is_empty_property(&self) -> bool {
14 self.is_empty()
15 }
16}
17
18impl LengthProperty for CString {
19 fn length_property(&self) -> usize {
20 self.as_bytes().len()
21 }
22}
23
24impl LengthProperty for &CStr {
25 fn length_property(&self) -> usize {
26 self.to_bytes().len()
27 }
28}
29
30#[cfg(test)]
31mod tests;