Skip to content
Snippets Groups Projects

Use C string literals & deprecate `c_str!`

Merged Josh Megnauth requested to merge josh/relibc:use-cstr-literals-minimal into master
+ 1
1
@@ -54,7 +54,7 @@ impl<'a> CStr<'a> {
pub const fn as_ptr(self) -> *const c_char {
self.ptr.as_ptr()
}
pub unsafe fn from_bytes_with_nul_unchecked(bytes: &'a [u8]) -> Self {
pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &'a [u8]) -> Self {
Self::from_ptr(bytes.as_ptr().cast())
}
pub fn from_bytes_with_nul(bytes: &'a [u8]) -> Result<Self, FromBytesWithNulError> {
Loading