mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
Cleaner cstr code
This commit is contained in:
parent
eda8c70a80
commit
6d1e8d86cb
@ -568,7 +568,7 @@ macro_rules! impl_str_write {
|
|||||||
impl<$($g)*> AsMut<Utf8CStr> for $t {
|
impl<$($g)*> AsMut<Utf8CStr> for $t {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn as_mut(&mut self) -> &mut Utf8CStr {
|
fn as_mut(&mut self) -> &mut Utf8CStr {
|
||||||
self
|
self.as_utf8_cstr_mut()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)*}
|
)*}
|
||||||
@ -597,10 +597,8 @@ macro_rules! impl_str_buf {
|
|||||||
}
|
}
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn clear(&mut self) {
|
fn clear(&mut self) {
|
||||||
unsafe {
|
self.buf[0] = b'\0';
|
||||||
self.mut_buf()[0] = b'\0';
|
self.used = 0;
|
||||||
self.set_len(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)*}
|
)*}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user