From 10c00138e8afa4a7ab9ba5f74c19676236f2321d Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 26 Jul 2023 07:27:41 +0900 Subject: [PATCH] Add conversion from Either to EitherOrBoth --- src/either_or_both.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/either_or_both.rs b/src/either_or_both.rs index cf65fe788..baf540c34 100644 --- a/src/either_or_both.rs +++ b/src/either_or_both.rs @@ -493,3 +493,12 @@ impl Into>> for EitherOrBoth { } } } + +impl From> for EitherOrBoth { + fn from(either: Either) -> Self { + match either { + Either::Left(l) => EitherOrBoth::Left(l), + Either::Right(l) => EitherOrBoth::Right(l), + } + } +}