Skip to content

Commit

Permalink
impl From<T> for Mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored and cramertj committed Aug 30, 2019
1 parent 8019d99 commit d879db3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions futures-util/src/lock/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ impl<T: ?Sized> fmt::Debug for Mutex<T> {
}
}

impl<T> From<T> for Mutex<T> {
fn from(t: T) -> Self {
Self::new(t)
}
}

impl<T: Default> Default for Mutex<T> {
fn default() -> Mutex<T> {
Mutex::new(Default::default())
Expand Down

0 comments on commit d879db3

Please sign in to comment.