core: simplify CStr::default()
Just use a `CStr`-literal...
This commit is contained in:
parent
975e6c8fec
commit
aa537824c4
1 changed files with 1 additions and 3 deletions
|
|
@ -179,9 +179,7 @@ impl fmt::Debug for CStr {
|
|||
impl Default for &CStr {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
const SLICE: &[c_char] = &[0];
|
||||
// SAFETY: `SLICE` is indeed pointing to a valid nul-terminated string.
|
||||
unsafe { CStr::from_ptr(SLICE.as_ptr()) }
|
||||
c""
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue