pub enum Usefulness<'p, Cx: PatCx> {
Useful(Vec<(&'p DeconstructedPat<Cx>, RedundancyExplanation<'p, Cx>)>),
Redundant(RedundancyExplanation<'p, Cx>),
}
Expand description
Indicates whether or not a given arm is useful.
Variants§
Useful(Vec<(&'p DeconstructedPat<Cx>, RedundancyExplanation<'p, Cx>)>)
The arm is useful. This additionally carries a set of or-pattern branches that have been found to be redundant despite the overall arm being useful. Used only in the presence of or-patterns, otherwise it stays empty.
Redundant(RedundancyExplanation<'p, Cx>)
The arm is redundant and can be removed without changing the behavior of the match expression.
Trait Implementations§
Source§impl<'p, Cx: Clone + PatCx> Clone for Usefulness<'p, Cx>
impl<'p, Cx: Clone + PatCx> Clone for Usefulness<'p, Cx>
Source§fn clone(&self) -> Usefulness<'p, Cx>
fn clone(&self) -> Usefulness<'p, Cx>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'p, Cx> Freeze for Usefulness<'p, Cx>
impl<'p, Cx> RefUnwindSafe for Usefulness<'p, Cx>where
<Cx as PatCx>::Ty: RefUnwindSafe,
<Cx as PatCx>::PatData: RefUnwindSafe,
<Cx as PatCx>::VariantIdx: RefUnwindSafe,
<Cx as PatCx>::StrLit: RefUnwindSafe,
impl<'p, Cx> Send for Usefulness<'p, Cx>
impl<'p, Cx> Sync for Usefulness<'p, Cx>
impl<'p, Cx> Unpin for Usefulness<'p, Cx>
impl<'p, Cx> UnwindSafe for Usefulness<'p, Cx>where
<Cx as PatCx>::Ty: RefUnwindSafe,
<Cx as PatCx>::PatData: RefUnwindSafe,
<Cx as PatCx>::VariantIdx: RefUnwindSafe,
<Cx as PatCx>::StrLit: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more