Skip to content

Commit

Permalink
fix always true/false case in answer length
Browse files Browse the repository at this point in the history
  • Loading branch information
KavikaPalletenne committed Nov 5, 2024
1 parent 06efb2c commit 848d476
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/server/src/models/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ pub enum AnswerData {
impl AnswerData {
pub async fn validate(self) -> Result<()> {
match self {
Self::ShortAnswer(text) => if text.len() <= 0 {bail!("Empty answer")},
Self::MultiSelect(data) => if data.len() <= 0 {bail!("Empty answer")},
Self::ShortAnswer(text) => if text.len() == 0 { bail!("Empty answer") },
Self::MultiSelect(data) => if data.len() == 0 { bail!("Empty answer") },
_ => {},
}

Expand Down

0 comments on commit 848d476

Please sign in to comment.