Use static methods in cxx-rs

This commit is contained in:
topjohnwu
2025-02-02 02:42:18 +08:00
parent 58a25a3e2b
commit 59622d1688
11 changed files with 51 additions and 59 deletions
+4 -4
View File
@@ -73,6 +73,10 @@ pub struct MagiskD {
}
impl MagiskD {
pub fn get() -> &'static MagiskD {
unsafe { MAGISKD.get().unwrap_unchecked() }
}
pub fn is_recovery(&self) -> bool {
self.is_recovery
}
@@ -300,7 +304,3 @@ fn check_data() -> bool {
}
false
}
pub fn get_magiskd() -> &'static MagiskD {
unsafe { MAGISKD.get().unwrap_unchecked() }
}