Open
Description
Littered throughout the CStr
documentation are notes and hints that it should be eventually converted to using a pointer underneath the hood instead of a slice. This change will make CStr::from_ptr
O(1) instead of O(n). Other constructors may still be O(n) because they have to check to ensure there is only one null terminator. If someone wants to try implementing this, it seems like a pretty simple change.
pub struct CStr {
inner: [c_char]
}
Proposed:
pub struct CStr {
inner: *const c_char
}