From cf7fc7fc6acb1eeb602230cf071569415ef012e0 Mon Sep 17 00:00:00 2001 From: Philippe-Cholet <phcholet@orange.fr> Date: Fri, 12 Jan 2024 09:11:51 +0100 Subject: [PATCH] Either or both: `impl From` implies `impl Into` I removed the clippy lint, commit, run `clippy --fix`, squash. --- src/either_or_both.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/either_or_both.rs b/src/either_or_both.rs index d13763441..b7a7fc141 100644 --- a/src/either_or_both.rs +++ b/src/either_or_both.rs @@ -494,10 +494,9 @@ impl<T> EitherOrBoth<T, T> { } } -#[allow(clippy::from_over_into)] -impl<A, B> Into<Option<Either<A, B>>> for EitherOrBoth<A, B> { - fn into(self) -> Option<Either<A, B>> { - match self { +impl<A, B> From<EitherOrBoth<A, B>> for Option<Either<A, B>> { + fn from(value: EitherOrBoth<A, B>) -> Self { + match value { Left(l) => Some(Either::Left(l)), Right(r) => Some(Either::Right(r)), Both(..) => None,