Skip to content

Commit

Permalink
Use match instead of nested if
Browse files Browse the repository at this point in the history
  • Loading branch information
kimrutherford committed Sep 27, 2024
1 parent 74884dd commit f52c7fb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/pombase/bio/generic_annotation_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,10 @@ pub fn write_from_uniprot_map(uniprot_data_map: &UniProtDataMap,
let reference = site.reference.as_deref().unwrap_or(uniprot_pmid);
let termid = &site.termid;
let residue_abbrev =
if termid == "MOD:00047" {
"T"
} else {
if termid == "MOD:00046" {
"S"
} else {
""
}
match termid.as_str() {
"MOD:00047" => "T",
"MOD:00046" => "S",
_ => "",
};
let residue_extension = format!("residue({}{})", residue_abbrev, site.range);
write_generic_annotation(&mut writer,
Expand Down

0 comments on commit f52c7fb

Please sign in to comment.