Skip to content

Commit

Permalink
Bit nicer search results display
Browse files Browse the repository at this point in the history
  • Loading branch information
douweschulte committed Mar 28, 2024
1 parent a97e8d7 commit 6b5fa75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ async fn search_modification(text: &str, tolerance: f64) -> Result<String, Strin

for rule in rules {
ul = ul.content(HtmlElement::new(HtmlTag::li).content(
format!("Positions: {}, Neutral losses: {}, Diagnostic ions: {}",&rule.0.iter().map(|rule| match rule {
format!("Positions: {}{}{}{}{}",&rule.0.iter().map(|rule| match rule {
PlacementRule::AminoAcid(aa, pos) => {
format!(
"{}@{}",
Expand All @@ -221,8 +221,10 @@ async fn search_modification(text: &str, tolerance: f64) -> Result<String, Strin
PlacementRule::Terminal(pos) => {
format!("{}", pos)
}
}).join(",") ,
}).join(","),
if rule.1.is_empty() { ""} else {", Neutral losses: "},
rule.1.iter().join(","),
if rule.2.is_empty() { ""} else {", Diagnostic ions: "},
rule.2.iter().map(|ion| ion.0.to_string()).join(","))
));
}
Expand Down

0 comments on commit 6b5fa75

Please sign in to comment.