Loading crates/tor-persist/src/handle.rs +0 −6 Original line number Diff line number Diff line Loading @@ -22,9 +22,6 @@ pub trait StorageHandle<T: Serialize + DeserializeOwned> { /// Return true if we have the lock; see [`StateMgr::can_store`]. fn can_store(&self) -> bool; /// Try to acquire the lock; see [`StateMgr::can_store`]. fn try_lock(&self) -> Result<bool>; } /// Type wrapper for a reference-counted `dyn` [`StorageHandle`]. Loading Loading @@ -69,9 +66,6 @@ where fn can_store(&self) -> bool { self.mgr.can_store() } fn try_lock(&self) -> Result<bool> { Ok(self.mgr.try_lock()?.held()) } } impl<M, T> StorageHandleImpl<M, T> Loading crates/tor-persist/src/testing.rs +2 −2 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ mod test { let h1: DynStorageHandle<Ex1> = mgr.clone().create_handle("foo"); let h2: DynStorageHandle<Ex2> = mgr.clone().create_handle("bar"); let h3: DynStorageHandle<Ex2> = mgr.create_handle("baz"); let h3: DynStorageHandle<Ex2> = mgr.clone().create_handle("baz"); let v1 = Ex1 { v1: 1, v2: 2 }; let s1 = Ex2 { Loading @@ -189,7 +189,7 @@ mod test { }; assert!(matches!(h1.store(&v1), Err(Error::NoLock))); assert!(h1.try_lock().unwrap()); assert!(mgr.try_lock().unwrap().held()); assert!(h1.can_store()); assert!(h1.store(&v1).is_ok()); Loading Loading
crates/tor-persist/src/handle.rs +0 −6 Original line number Diff line number Diff line Loading @@ -22,9 +22,6 @@ pub trait StorageHandle<T: Serialize + DeserializeOwned> { /// Return true if we have the lock; see [`StateMgr::can_store`]. fn can_store(&self) -> bool; /// Try to acquire the lock; see [`StateMgr::can_store`]. fn try_lock(&self) -> Result<bool>; } /// Type wrapper for a reference-counted `dyn` [`StorageHandle`]. Loading Loading @@ -69,9 +66,6 @@ where fn can_store(&self) -> bool { self.mgr.can_store() } fn try_lock(&self) -> Result<bool> { Ok(self.mgr.try_lock()?.held()) } } impl<M, T> StorageHandleImpl<M, T> Loading
crates/tor-persist/src/testing.rs +2 −2 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ mod test { let h1: DynStorageHandle<Ex1> = mgr.clone().create_handle("foo"); let h2: DynStorageHandle<Ex2> = mgr.clone().create_handle("bar"); let h3: DynStorageHandle<Ex2> = mgr.create_handle("baz"); let h3: DynStorageHandle<Ex2> = mgr.clone().create_handle("baz"); let v1 = Ex1 { v1: 1, v2: 2 }; let s1 = Ex2 { Loading @@ -189,7 +189,7 @@ mod test { }; assert!(matches!(h1.store(&v1), Err(Error::NoLock))); assert!(h1.try_lock().unwrap()); assert!(mgr.try_lock().unwrap().held()); assert!(h1.can_store()); assert!(h1.store(&v1).is_ok()); Loading