diff options
Diffstat (limited to 'src/db/model/state.rs')
| -rw-r--r-- | src/db/model/state.rs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/db/model/state.rs b/src/db/model/state.rs index dcc9b84..18860ff 100644 --- a/src/db/model/state.rs +++ b/src/db/model/state.rs @@ -118,20 +118,6 @@ impl ReleaseState { pub fn parse(s: &str) -> Option<ReleaseState> { ReleaseState::ALL.iter().copied().find(|r| r.as_str() == s) } - - /// NOTE: nothing consults this table today — release transitions are - /// enforced elsewhere. Left `pub` and dead rather than quietly deleted - /// or quietly wired up; it is a disposition-table decision. - pub fn can_transition(&self, to: ReleaseState) -> bool { - use ReleaseState::*; - if *self == to { - return true; - } - match self { - Published => matches!(to, Withdrawn | FailedUnbuilt), - Withdrawn | FailedUnbuilt => false, - } - } } impl std::fmt::Display for ReleaseState { @@ -199,20 +185,6 @@ impl SubscriptionState { pub fn parse(text: &str) -> Option<SubscriptionState> { SubscriptionState::ALL.iter().copied().find(|st| st.as_str() == text) } - - /// NOTE: dead in the same way as `ReleaseState::can_transition`. - pub fn can_transition(&self, to: SubscriptionState) -> bool { - use SubscriptionState::*; - if *self == to { - return true; - } - match self { - Active => matches!(to, Paused | Orphaned | Removed), - Paused => matches!(to, Active | Orphaned | Removed), - Orphaned => matches!(to, Active | Removed), - Removed => false, - } - } } impl std::fmt::Display for SubscriptionState { |
