Skip to content

Commit

Permalink
Either or both: impl From implies impl Into
Browse files Browse the repository at this point in the history
I removed the clippy lint, commit, run `clippy --fix`, squash.
  • Loading branch information
Philippe-Cholet committed Jan 12, 2024
1 parent 2f4739c commit cf7fc7f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/either_or_both.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cf7fc7f

Please sign in to comment.