Skip to content

Commit 0f16f5a

Browse files
committed
fix: issue#93
1 parent 0c59b3a commit 0f16f5a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/cache/models.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff 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
&"\nExpected:".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

src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn reset_signal_pipe_handler() {
2323
}
2424
}
2525

26-
/// Get maches
26+
/// Get matches
2727
pub async fn main() -> Result<(), Error> {
2828
reset_signal_pipe_handler();
2929
let m = clap::Command::new(crate_name!())

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy