Skip to content

Commit a9771c1

Browse files
committed
style: clippy fix unnecessary_unwrap
1 parent 1940b1e commit a9771c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/params.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,13 +1396,13 @@ impl FromStr for CURIE {
13961396
.next()
13971397
.ok_or(CURIEParsingError::MissingNamespaceSeparator)?;
13981398
let accession = tokens.next();
1399-
if accession.is_none() {
1400-
Err(CURIEParsingError::MissingNamespaceSeparator)
1401-
} else {
1399+
if let Some(accession) = accession {
14021400
let cv: ControlledVocabulary = cv.parse::<ControlledVocabulary>()?;
14031401

1404-
let accession = accession.unwrap().parse()?;
1402+
let accession = accession.parse()?;
14051403
Ok(CURIE::new(cv, accession))
1404+
} else {
1405+
Err(CURIEParsingError::MissingNamespaceSeparator)
14061406
}
14071407
}
14081408
}

0 commit comments

Comments
 (0)