@@ -72,10 +72,13 @@ impl Type<Postgres> for JobStatus {
72
72
73
73
#[ cfg( feature = "postgres" ) ]
74
74
impl Encode < ' _ , Postgres > for JobStatus {
75
- fn encode_by_ref ( & self , buf : & mut sqlx:: postgres:: PgArgumentBuffer ) -> Result < sqlx:: encode:: IsNull , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
75
+ fn encode_by_ref (
76
+ & self ,
77
+ buf : & mut sqlx:: postgres:: PgArgumentBuffer ,
78
+ ) -> Result < sqlx:: encode:: IsNull , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
76
79
let status_str = match self {
77
80
JobStatus :: Pending => "Pending" ,
78
- JobStatus :: Running => "Running" ,
81
+ JobStatus :: Running => "Running" ,
79
82
JobStatus :: Completed => "Completed" ,
80
83
JobStatus :: Failed => "Failed" ,
81
84
JobStatus :: Dead => "Dead" ,
@@ -116,11 +119,14 @@ impl Type<MySql> for JobStatus {
116
119
117
120
#[ cfg( feature = "mysql" ) ]
118
121
impl Encode < ' _ , MySql > for JobStatus {
119
- fn encode_by_ref ( & self , buf : & mut Vec < u8 > ) -> Result < sqlx:: encode:: IsNull , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
122
+ fn encode_by_ref (
123
+ & self ,
124
+ buf : & mut Vec < u8 > ,
125
+ ) -> Result < sqlx:: encode:: IsNull , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
120
126
let status_str = match self {
121
127
JobStatus :: Pending => "Pending" ,
122
128
JobStatus :: Running => "Running" ,
123
- JobStatus :: Completed => "Completed" ,
129
+ JobStatus :: Completed => "Completed" ,
124
130
JobStatus :: Failed => "Failed" ,
125
131
JobStatus :: Dead => "Dead" ,
126
132
JobStatus :: TimedOut => "TimedOut" ,
@@ -2280,8 +2286,12 @@ mod tests {
2280
2286
"Archived" => JobStatus :: Archived ,
2281
2287
_ => panic ! ( "Unknown job status: {}" , input) ,
2282
2288
} ;
2283
-
2284
- assert_eq ! ( * expected, parsed_status, "Failed to parse '{}' correctly" , input) ;
2289
+
2290
+ assert_eq ! (
2291
+ * expected, parsed_status,
2292
+ "Failed to parse '{}' correctly" ,
2293
+ input
2294
+ ) ;
2285
2295
}
2286
2296
}
2287
2297
@@ -2311,12 +2321,24 @@ mod tests {
2311
2321
JobStatus :: Retrying => "Retrying" ,
2312
2322
JobStatus :: Archived => "Archived" ,
2313
2323
} ;
2314
-
2315
- assert_eq ! ( * expected_str, encoded_str, "Encoding mismatch for {:?}" , status) ;
2316
-
2324
+
2325
+ assert_eq ! (
2326
+ * expected_str, encoded_str,
2327
+ "Encoding mismatch for {:?}" ,
2328
+ status
2329
+ ) ;
2330
+
2317
2331
// Verify the encoded string does not have quotes
2318
- assert ! ( !encoded_str. starts_with( '"' ) , "Encoded string should not start with quotes: {}" , encoded_str) ;
2319
- assert ! ( !encoded_str. ends_with( '"' ) , "Encoded string should not end with quotes: {}" , encoded_str) ;
2332
+ assert ! (
2333
+ !encoded_str. starts_with( '"' ) ,
2334
+ "Encoded string should not start with quotes: {}" ,
2335
+ encoded_str
2336
+ ) ;
2337
+ assert ! (
2338
+ !encoded_str. ends_with( '"' ) ,
2339
+ "Encoded string should not end with quotes: {}" ,
2340
+ encoded_str
2341
+ ) ;
2320
2342
}
2321
2343
}
2322
2344
}
0 commit comments