Skip to content

Commit fd65a7e

Browse files
committed
Fix some clippy errors.
Add a default implementation, and pass by value for WaitTimeoutResult
1 parent e3fa5f1 commit fd65a7e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/sync/condvar.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct WaitTimeoutResult(bool);
1515
/// not
1616
impl WaitTimeoutResult {
1717
/// Returns `true` if the wait was known to have timed out.
18-
pub fn timed_out(&self) -> bool {
18+
pub fn timed_out(self) -> bool {
1919
self.0
2020
}
2121
}
@@ -62,6 +62,12 @@ pub struct Condvar {
6262
blocked: std::sync::Mutex<Slab<Option<Waker>>>,
6363
}
6464

65+
impl Default for Condvar {
66+
fn default() -> Self {
67+
Condvar::new()
68+
}
69+
}
70+
6571
impl Condvar {
6672
/// Creates a new condition variable
6773
///

0 commit comments

Comments
 (0)