Skip to content

Commit

Permalink
Implement default for Callback<T> (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNeikos authored Mar 29, 2020
1 parent d81168b commit 91fb5f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ impl<IN> Callback<IN> {
}
}

impl<IN> Default for Callback<IN> {
fn default() -> Self {
Self::noop()
}
}

impl<IN: 'static> Callback<IN> {
/// Changes input type of the callback to another.
/// Works like common `map` method but in an opposite direction.
Expand Down

0 comments on commit 91fb5f5

Please sign in to comment.