Skip to content

Commit 03a6a7c

Browse files
committed
Better suggestion for charge in v2.0 syntax
1 parent 36e0387 commit 03a6a7c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

mzcore/src/sequence/peptidoform/parse.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,8 @@ fn labile_modifications<'a, const STRICT: bool>(
15501550
}
15511551

15521552
/// Parse a charge state, defaulting to v2.1 but allowing fallback to v2.0 if needed.
1553+
/// # Errors
1554+
/// If this definition is neither a v2.1 or v2.0 valid charge
15531555
fn parse_charge_state<'a>(
15541556
base_context: &Context<'a>,
15551557
line: &'a str,
@@ -1567,7 +1569,7 @@ fn parse_charge_state<'a>(
15671569
"Deprecated charge",
15681570
"A charge using the deprecated syntax of the ProForma 2.0 charge extension was detected",
15691571
base_context.clone().add_highlight((0, range.start, 1)),
1570-
).suggestions([v.to_string()]));
1572+
).suggestions([format!("/{v}")]));
15711573
((offset, v), errors)
15721574
})
15731575
} else {

0 commit comments

Comments
 (0)