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§
Auto Trait Implementations§
impl<'p, Cx> Freeze for Usefulness<'p, Cx>where
Vec<(&'p DeconstructedPat<Cx>, RedundancyExplanation<'p, Cx>)>: Freeze,
RedundancyExplanation<'p, Cx>: Freeze,
impl<'p, Cx> RefUnwindSafe for Usefulness<'p, Cx>where
Vec<(&'p DeconstructedPat<Cx>, RedundancyExplanation<'p, Cx>)>: RefUnwindSafe,
RedundancyExplanation<'p, Cx>: RefUnwindSafe,
impl<'p, Cx> Send for Usefulness<'p, Cx>where
Vec<(&'p DeconstructedPat<Cx>, RedundancyExplanation<'p, Cx>)>: Send,
RedundancyExplanation<'p, Cx>: Send,
impl<'p, Cx> Sync for Usefulness<'p, Cx>where
Vec<(&'p DeconstructedPat<Cx>, RedundancyExplanation<'p, Cx>)>: Sync,
RedundancyExplanation<'p, Cx>: Sync,
impl<'p, Cx> Unpin for Usefulness<'p, Cx>where
Vec<(&'p DeconstructedPat<Cx>, RedundancyExplanation<'p, Cx>)>: Unpin,
RedundancyExplanation<'p, Cx>: Unpin,
impl<'p, Cx> UnsafeUnpin for Usefulness<'p, Cx>where
Vec<(&'p DeconstructedPat<Cx>, RedundancyExplanation<'p, Cx>)>: UnsafeUnpin,
RedundancyExplanation<'p, Cx>: UnsafeUnpin,
impl<'p, Cx> UnwindSafe for Usefulness<'p, Cx>where
Vec<(&'p DeconstructedPat<Cx>, RedundancyExplanation<'p, Cx>)>: UnwindSafe,
RedundancyExplanation<'p, Cx>: UnwindSafe,
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