Remove redundant LifecycleEventKind enum and its From impl
Intent: The `LifecycleEventKind` enum was a 1:1 mirror of `RuntimeState` with a trivial identity `From` conversion. Removing it and replacing it with a type alias eliminates unnecessary indirection while preserving backward compatibility for any downstream code that references the name.
Affected files: crates/pika-cloud/src/lifecycle.rs
@@ -18,38 +23,6 @@ pub enum RuntimeState {
Completed,
}
-#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
-#[serde(rename_all = "snake_case")]
-pub enum LifecycleEventKind {
- Requested,
- Provisioning,
- ...
@@ -153,6 +270,15 @@ pub type RuntimeTerminalResult = LifecycleTerminalResult;
+pub type LifecycleEventKind = RuntimeState;
The LifecycleEventKind enum duplicated every variant of RuntimeState and existed only to be converted back via From<LifecycleEventKind> for RuntimeState, which was an identity mapping. Both the enum and the impl are removed, and LifecycleEventKind becomes a simple type alias:
pub type LifecycleEventKind = RuntimeState;
A new test confirms the alias is equivalent:
#[test]
fn lifecycle_event_kind_alias_matches_runtime_state() {
let kind: LifecycleEventKind = RuntimeState::Ready;
assert_eq!(kind, RuntimeState::Ready);
}
This avoids the maintenance burden of keeping two identical enum definitions in sync.