mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
Revert "refactor: profile switch (#5197)"
This reverts commit c2dcd86722.
This commit is contained in:
@@ -68,13 +68,6 @@ impl<T: Clone + ToOwned> Draft<Box<T>> {
|
||||
})
|
||||
}
|
||||
|
||||
/// 尝试获取最新只读视图,若当前持有写锁则返回 `None`
|
||||
pub fn try_latest_ref(&self) -> Option<MappedRwLockReadGuard<'_, Box<T>>> {
|
||||
self.inner
|
||||
.try_read()
|
||||
.map(|guard| RwLockReadGuard::map(guard, |inner| inner.1.as_ref().unwrap_or(&inner.0)))
|
||||
}
|
||||
|
||||
/// 提交草稿,返回旧正式数据
|
||||
pub fn apply(&self) -> Option<Box<T>> {
|
||||
let mut inner = self.inner.write();
|
||||
|
||||
Reference in New Issue
Block a user