Amanieu / cstr_core

Implementation of CStr and CString for no_std environments
Apache License 2.0
41 stars 17 forks source link

Added compile time `cstr` macro #22

Closed VictorKoenders closed 3 years ago

VictorKoenders commented 3 years ago

Adds a cstr! macro that validates at compile time that the given string does not contain \0 bytes. The macro appends \0 and then calls unsafe { $crate::CStr::from_bytes_with_nul_unchecked(a.as_bytes()) } as suggested in #18

Closes #18

VictorKoenders commented 3 years ago

Updated documentation based on the given feedback

Amanieu commented 3 years ago

Thanks! Published 0.2.4.