diff --git a/backend/migration/src/m20231207_000001_create_table.rs b/backend/migration/src/m20231207_000001_create_table.rs index f15453f..9e165cd 100644 --- a/backend/migration/src/m20231207_000001_create_table.rs +++ b/backend/migration/src/m20231207_000001_create_table.rs @@ -104,7 +104,7 @@ enum Submit { Status, Accept, Score, - Public + Public, } #[derive(Iden)] enum Testcase { diff --git a/backend/src/endpoint/submit.rs b/backend/src/endpoint/submit.rs index 36de25a..b3e474e 100644 --- a/backend/src/endpoint/submit.rs +++ b/backend/src/endpoint/submit.rs @@ -1,5 +1,4 @@ use super::*; -use futures::{FutureExt, TryFutureExt}; use crate::controller::judger::SubmitBuilder; use crate::util::code::Code; @@ -16,9 +15,9 @@ impl From for SubmitInfo { fn from(value: Model) -> Self { let db_code: Code = value .status - .map(TryInto::try_into) + .map(|x| x.try_into().ok()) .flatten() - .unwrap_or_else(Code::Unknown); + .unwrap_or(Code::Unknown); SubmitInfo { id: value.id, upload_time: into_prost(value.upload_at),