refactor: done

This commit is contained in:
GyDi
2022-11-18 18:18:41 +08:00
parent ce2d4498e1
commit bedd3abf8a
24 changed files with 343 additions and 341 deletions

View File

@@ -1,4 +1,4 @@
use super::{IClashTemp, IProfiles, IVerge};
use super::{IClashTemp, IProfiles, IRuntime, IVerge};
use parking_lot::{MappedMutexGuard, Mutex, MutexGuard};
use std::sync::Arc;
@@ -10,6 +10,7 @@ pub struct Draft<T: Clone + ToOwned> {
macro_rules! draft_define {
($id: ident) => {
impl Draft<$id> {
#[allow(unused)]
pub fn data(&self) -> MappedMutexGuard<$id> {
MutexGuard::map(self.inner.lock(), |guard| &mut guard.0)
}
@@ -65,9 +66,9 @@ macro_rules! draft_define {
// draft_define!(IClash);
draft_define!(IClashTemp);
draft_define!(IVerge);
// draft_define!(Mapping);
draft_define!(IProfiles);
draft_define!(IRuntime);
draft_define!(IVerge);
#[test]
fn test_draft() {