@@ -805,13 +805,18 @@ pub enum BenchmarkRequestStatus {
805805 Completed ,
806806}
807807
808+ const WAITING_FOR_ARTIFACTS_STR : & str = "waiting_for_artifacts" ;
809+ const ARTIFACTS_READY_STR : & str = "artifacts_ready" ;
810+ const IN_PROGRESS_STR : & str = "in_progress" ;
811+ const COMPLETED_STR : & str = "completed" ;
812+
808813impl BenchmarkRequestStatus {
809814 pub fn as_str ( & self ) -> & str {
810815 match self {
811- BenchmarkRequestStatus :: WaitingForArtifacts => "waiting_for_artifacts" ,
812- BenchmarkRequestStatus :: ArtifactsReady => "artifacts_ready" ,
813- BenchmarkRequestStatus :: InProgress => "in_progress" ,
814- BenchmarkRequestStatus :: Completed => "completed" ,
816+ BenchmarkRequestStatus :: WaitingForArtifacts => WAITING_FOR_ARTIFACTS_STR ,
817+ BenchmarkRequestStatus :: ArtifactsReady => ARTIFACTS_READY_STR ,
818+ BenchmarkRequestStatus :: InProgress => IN_PROGRESS_STR ,
819+ BenchmarkRequestStatus :: Completed { .. } => COMPLETED_STR ,
815820 }
816821 }
817822}
@@ -831,10 +836,10 @@ impl<'a> tokio_postgres::types::FromSql<'a> for BenchmarkRequestStatus {
831836 let s: & str = <& str as tokio_postgres:: types:: FromSql >:: from_sql ( ty, raw) ?;
832837
833838 match s {
834- x if x == Self :: WaitingForArtifacts . as_str ( ) => Ok ( Self :: WaitingForArtifacts ) ,
835- x if x == Self :: ArtifactsReady . as_str ( ) => Ok ( Self :: ArtifactsReady ) ,
836- x if x == Self :: InProgress . as_str ( ) => Ok ( Self :: InProgress ) ,
837- x if x == Self :: Completed . as_str ( ) => Ok ( Self :: Completed ) ,
839+ WAITING_FOR_ARTIFACTS_STR => Ok ( Self :: WaitingForArtifacts ) ,
840+ ARTIFACTS_READY_STR => Ok ( Self :: ArtifactsReady ) ,
841+ IN_PROGRESS_STR => Ok ( Self :: InProgress ) ,
842+ COMPLETED_STR => Ok ( Self :: Completed ) ,
838843 other => Err ( format ! ( "unknown benchmark_request_status '{other}'" ) . into ( ) ) ,
839844 }
840845 }
0 commit comments