Skip to main content

regex_syntax/
either.rs

1/// A simple binary sum type.
2///
3/// This is occasionally useful in an ad hoc fashion.
4#[derive(#[automatically_derived]impl<Left: ::core::clone::Clone,
    Right: ::core::clone::Clone> ::core::clone::Clone for Either<Left, Right>
    {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::Left(__self_0) =>
                Either::Left(::core::clone::Clone::clone(__self_0)),
            Self::Right(__self_0) =>
                Either::Right(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]impl<Left: ::core::fmt::Debug,
    Right: ::core::fmt::Debug> ::core::fmt::Debug for Either<Left, Right> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Left(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Left",
                    &__self_0),
            Self::Right(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Right",
                    &__self_0),
        }
    }
}Debug, #[automatically_derived]impl<Left: ::core::cmp::Eq, Right: ::core::cmp::Eq>
    ::core::cmp::Eq for Either<Left, Right> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Left>;
        let _: ::core::cmp::AssertParamIsEq<Right>;
    }
}Eq, #[automatically_derived]impl<Left: ::core::cmp::PartialEq,
    Right: ::core::cmp::PartialEq> ::core::marker::StructuralPartialEq for
    Either<Left, Right> {
}
#[automatically_derived]impl<Left: ::core::cmp::PartialEq,
    Right: ::core::cmp::PartialEq> ::core::cmp::PartialEq for
    Either<Left, Right> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Left(__self_0), Self::Left(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Right(__self_0), Self::Right(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq)]
5pub enum Either<Left, Right> {
6    Left(Left),
7    Right(Right),
8}