Skip to content

Commit 7559b58

Browse files
refactor: reduced use of return statements
1 parent 95afbc8 commit 7559b58

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

backend/src/qp.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ impl TryFrom<&String> for Exam {
7878
Ok(Exam::Endsem)
7979
} else if let Some(stripped) = value.strip_prefix("ct") {
8080
if stripped.is_empty() {
81-
return Ok(Exam::CT(None));
82-
}
83-
84-
if let Ok(i) = stripped.parse::<usize>() {
81+
Ok(Exam::CT(None))
82+
} else if let Ok(i) = stripped.parse::<usize>() {
8583
Ok(Exam::CT(Some(i)))
8684
} else {
8785
Err(eyre!("Error parsing exam: Invalid class test number."))

0 commit comments

Comments
 (0)