diff --git a/server/src/pipeline_state.rs b/server/src/pipeline_state.rs index fddb8d66..2911b3ea 100644 --- a/server/src/pipeline_state.rs +++ b/server/src/pipeline_state.rs @@ -223,10 +223,7 @@ pub enum PipelineEvent { #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub enum TransitionError { - InvalidTransition { - from_stage: String, - event: String, - }, + InvalidTransition { from_stage: String, event: String }, } impl fmt::Display for TransitionError { @@ -263,11 +260,23 @@ pub fn transition(state: Stage, event: PipelineEvent) -> Result Ok(Coding), (Coding, GatesStarted) => Ok(Qa), - (Coding, QaSkipped { feature_branch, commits_ahead }) => Ok(Merge { + ( + Coding, + QaSkipped { + feature_branch, + commits_ahead, + }, + ) => Ok(Merge { feature_branch, commits_ahead, }), - (Qa, GatesPassed { feature_branch, commits_ahead }) => Ok(Merge { + ( + Qa, + GatesPassed { + feature_branch, + commits_ahead, + }, + ) => Ok(Merge { feature_branch, commits_ahead, }), @@ -507,10 +516,7 @@ pub enum ProjectionError { /// A required field is missing from the CRDT data. MissingField(&'static str), /// A field has an invalid value. - InvalidField { - field: &'static str, - detail: String, - }, + InvalidField { field: &'static str, detail: String }, } impl fmt::Display for ProjectionError { @@ -575,8 +581,7 @@ fn project_stage(view: &PipelineItemView) -> Result { // at least one commit). Ok(Stage::Merge { feature_branch: BranchName(branch), - commits_ahead: NonZeroU32::new(1) - .expect("1 is non-zero"), + commits_ahead: NonZeroU32::new(1).expect("1 is non-zero"), }) } "5_done" => { @@ -1094,10 +1099,7 @@ mod tests { assert!(matches!(e, ExecutionState::Running { .. })); let e = execution_transition(e, ExecutionEvent::Exited { exit_code: 0 }).unwrap(); - assert!(matches!( - e, - ExecutionState::Completed { exit_code: 0, .. } - )); + assert!(matches!(e, ExecutionState::Completed { exit_code: 0, .. })); } #[test] @@ -1313,8 +1315,8 @@ mod tests { #[test] fn event_bus_fires_to_all_subscribers() { - use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::Arc; + use std::sync::atomic::{AtomicU32, Ordering}; struct CountingSub(Arc); impl TransitionSubscriber for CountingSub { @@ -1368,10 +1370,7 @@ mod tests { from_stage: "Backlog".into(), event: "Accepted".into(), }; - assert_eq!( - err.to_string(), - "invalid transition: Backlog + Accepted" - ); + assert_eq!(err.to_string(), "invalid transition: Backlog + Accepted"); } // ── ProjectionError Display ─────────────────────────────────────────