Skip to content

Commit a807faf

Browse files
committed
f dont add uneccessary wrapper types
1 parent 9c527c8 commit a807faf

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lightning/src/sync/debug_sync.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ use std::sync::RwLockReadGuard as StdRwLockReadGuard;
1212
use std::sync::RwLockWriteGuard as StdRwLockWriteGuard;
1313
use std::sync::Condvar as StdCondvar;
1414

15+
pub use std::sync::WaitTimeoutResult;
16+
1517
use crate::prelude::HashMap;
1618

1719
use super::{LockTestExt, LockHeldState};
@@ -26,11 +28,6 @@ impl Backtrace { fn new() -> Backtrace { Backtrace {} } }
2628

2729
pub type LockResult<Guard> = Result<Guard, ()>;
2830

29-
pub struct WaitTimeoutResult(bool);
30-
impl WaitTimeoutResult {
31-
pub fn timed_out(&self) -> bool { self.0 }
32-
}
33-
3431
pub struct Condvar {
3532
inner: StdCondvar,
3633
}
@@ -63,7 +60,7 @@ impl Condvar {
6360
-> LockResult<(MutexGuard<'a, T>, WaitTimeoutResult)> {
6461
let mutex = guard.mutex;
6562
self.inner.wait_timeout_while(guard.into_inner(), dur, condition).map_err(|_| ())
66-
.map(|(lock, e)| (MutexGuard { mutex, lock }, WaitTimeoutResult(e.timed_out())))
63+
.map(|(lock, e)| (MutexGuard { mutex, lock }, e))
6764
}
6865

6966
pub fn notify_all(&self) { self.inner.notify_all(); }

0 commit comments

Comments
 (0)