You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
resetprop: replace nanopb with quick-protobuf for persist
This commit is contained in:
@@ -345,6 +345,27 @@ impl Directory {
|
||||
})?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn for_all_file<F: FnMut(&DirEntry) -> io::Result<WalkResult>>(
|
||||
&mut self,
|
||||
mut f: F,
|
||||
) -> io::Result<WalkResult> {
|
||||
use WalkResult::*;
|
||||
loop {
|
||||
match self.read()? {
|
||||
None => return Ok(Continue),
|
||||
Some(ref e) => {
|
||||
if e.is_dir() {
|
||||
return Ok(Continue);
|
||||
}
|
||||
match f(e)? {
|
||||
Abort | Skip => return Ok(Continue),
|
||||
Continue => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Directory {
|
||||
|
||||
@@ -83,14 +83,14 @@ macro_rules! bfmt_cstr {
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! cstr {
|
||||
($str:literal) => {{
|
||||
($($str:tt)*) => {{
|
||||
assert!(
|
||||
!$str.bytes().any(|b| b == b'\0'),
|
||||
!($($str)*).bytes().any(|b| b == b'\0'),
|
||||
"cstr argument contains embedded NUL bytes",
|
||||
);
|
||||
#[allow(unused_unsafe)]
|
||||
unsafe {
|
||||
$crate::Utf8CStr::from_bytes_unchecked(concat!($str, "\0").as_bytes())
|
||||
$crate::Utf8CStr::from_bytes_unchecked(concat!($($str)*, "\0").as_bytes())
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user