push: Add convenience method to check if an action is a highlight tweak
This commit is contained in:
parent
03a58bcd88
commit
b6717bc2ea
@ -30,6 +30,13 @@ pub enum Action {
|
||||
_Custom(CustomAction),
|
||||
}
|
||||
|
||||
impl Action {
|
||||
/// Whether this action is an `Action::SetTweak(Tweak::Highlight(true))`.
|
||||
pub fn is_highlight(&self) -> bool {
|
||||
matches!(self, Action::SetTweak(Tweak::Highlight(true)))
|
||||
}
|
||||
}
|
||||
|
||||
/// The `set_tweak` action.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user