Skip to content

Commit

Permalink
Remove Verdict::and_then
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Jun 5, 2020
1 parent d1bb164 commit 74134a4
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions light-client/src/components/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ pub enum Verdict {
Invalid(VerificationError),
}

impl Verdict {
/// Execute the `next` action only if `self` is a successful verdict.
/// This allows chaining computations returning a `Verdict` until
/// on of them is not successful.
pub fn and_then<A: Into<Self>>(self, next: impl Fn() -> A) -> Self {
match self {
Verdict::Success => next().into(),
other => other,
}
}
}

impl From<Result<(), VerificationError>> for Verdict {
fn from(result: Result<(), VerificationError>) -> Self {
match result {
Expand Down

0 comments on commit 74134a4

Please sign in to comment.