Skip to content

Commit

Permalink
Fix some clippy errors.
Browse files Browse the repository at this point in the history
Add a default implementation, and pass by value for WaitTimeoutResult
  • Loading branch information
tmccombs committed Oct 28, 2019
1 parent e3fa5f1 commit fd65a7e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/sync/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct WaitTimeoutResult(bool);
/// not
impl WaitTimeoutResult {
/// Returns `true` if the wait was known to have timed out.
pub fn timed_out(&self) -> bool {
pub fn timed_out(self) -> bool {
self.0
}
}
Expand Down Expand Up @@ -62,6 +62,12 @@ pub struct Condvar {
blocked: std::sync::Mutex<Slab<Option<Waker>>>,
}

impl Default for Condvar {
fn default() -> Self {
Condvar::new()
}
}

impl Condvar {
/// Creates a new condition variable
///
Expand Down

0 comments on commit fd65a7e

Please sign in to comment.