Skip to content

Commit 007ae45

Browse files
bors[bot]glandium
andauthored
Merge #715
715: Add conversion from Either<A, B> to EitherOrBoth<A, B> r=phimuemue a=glandium Co-authored-by: Mike Hommey <[email protected]>
2 parents 62a6401 + 10c0013 commit 007ae45

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/either_or_both.rs

+9
Original file line numberDiff line numberDiff line change
@@ -493,3 +493,12 @@ impl<A, B> Into<Option<Either<A, B>>> for EitherOrBoth<A, B> {
493493
}
494494
}
495495
}
496+
497+
impl<A, B> From<Either<A, B>> for EitherOrBoth<A, B> {
498+
fn from(either: Either<A, B>) -> Self {
499+
match either {
500+
Either::Left(l) => EitherOrBoth::Left(l),
501+
Either::Right(l) => EitherOrBoth::Right(l),
502+
}
503+
}
504+
}

0 commit comments

Comments
 (0)