Skip to content

Commit 5a321ca

Browse files
Philippe-Choletjswrenn
authored andcommitted
Either or both: impl From implies impl Into
I removed the clippy lint, commit, run `clippy --fix`, squash.
1 parent 62bbd2f commit 5a321ca

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/either_or_both.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,9 @@ impl<T> EitherOrBoth<T, T> {
494494
}
495495
}
496496

497-
#[allow(clippy::from_over_into)]
498-
impl<A, B> Into<Option<Either<A, B>>> for EitherOrBoth<A, B> {
499-
fn into(self) -> Option<Either<A, B>> {
500-
match self {
497+
impl<A, B> From<EitherOrBoth<A, B>> for Option<Either<A, B>> {
498+
fn from(value: EitherOrBoth<A, B>) -> Self {
499+
match value {
501500
Left(l) => Some(Either::Left(l)),
502501
Right(r) => Some(Either::Right(r)),
503502
Both(..) => None,

0 commit comments

Comments
 (0)