You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Implement preinit related features in Rust
This commit is contained in:
@@ -22,3 +22,4 @@ argh = { workspace = true }
|
||||
bytemuck = { workspace = true }
|
||||
num-traits = { workspace = true }
|
||||
num-derive = { workspace = true }
|
||||
const_format = { workspace = true }
|
||||
|
||||
@@ -451,6 +451,7 @@ pub struct FsPathBuf<'a>(&'a mut dyn Utf8CStrWrite);
|
||||
|
||||
impl<'a> FsPathBuf<'a> {
|
||||
pub fn new(value: &'a mut dyn Utf8CStrWrite) -> Self {
|
||||
value.clear();
|
||||
FsPathBuf(value)
|
||||
}
|
||||
|
||||
@@ -656,7 +657,8 @@ macro_rules! cstr {
|
||||
);
|
||||
#[allow(unused_unsafe)]
|
||||
unsafe {
|
||||
$crate::Utf8CStr::from_bytes_unchecked(concat!($($str)*, "\0").as_bytes())
|
||||
$crate::Utf8CStr::from_bytes_unchecked($crate::const_format::concatcp!($($str)*, "\0")
|
||||
.as_bytes())
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#![feature(io_error_more)]
|
||||
#![feature(utf8_chunks)]
|
||||
|
||||
pub use const_format;
|
||||
pub use libc;
|
||||
use num_traits::FromPrimitive;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user