File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ impl std::fmt::Display for VerifyResult {
290290
291291 match & self . status . status_code {
292292 10 => {
293- if self . correct_answer {
293+ if matches ! ( self . result_type , Run :: Test ) && self . correct_answer {
294294 // Pass Tests
295295 write ! (
296296 f,
@@ -305,17 +305,20 @@ impl std::fmt::Display for VerifyResult {
305305 & "\n Expected:" . after_spaces( 6 ) ,
306306 eca,
307307 ) ?
308- } else if !self . submit . compare_result . is_empty ( ) {
308+ } else if matches ! ( self . result_type, Run :: Submit )
309+ && !self . submit . compare_result . is_empty ( )
310+ {
311+ // only Submit execute this branch
309312 // Submit Successfully
310- // TODO: result shoule be all 1;
313+ // TODO: result should be all 1;
311314 // Lines below are sucks...
312315 let cache = super :: Cache :: new ( ) . expect ( "cache gen failed" ) ;
313316 cache
314317 . update_after_ac (
315318 self . submit
316319 . question_id
317320 . parse ( )
318- . expect ( "submit succcessfully , parse question_id to i32 failed" ) ,
321+ . expect ( "submit successfully , parse question_id to i32 failed" ) ,
319322 )
320323 . expect ( "update ac to cache failed" ) ;
321324
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ pub fn reset_signal_pipe_handler() {
2323 }
2424}
2525
26- /// Get maches
26+ /// Get matches
2727pub async fn main ( ) -> Result < ( ) , Error > {
2828 reset_signal_pipe_handler ( ) ;
2929 let m = clap:: Command :: new ( crate_name ! ( ) )
You can’t perform that action at this time.
0 commit comments