seq: Simplify leading + handling

Address review comment.
This commit is contained in:
Nicolas Boichat
2025-04-03 17:26:38 +02:00
committed by Daniel Hofstetter
parent 27efb9eff4
commit 04a12820bb
+1 -4
View File
@@ -27,12 +27,9 @@ pub enum ParseNumberError {
// need to be too careful.
fn compute_num_digits(input: &str, ebd: ExtendedBigDecimal) -> PreciseNumber {
let input = input.to_lowercase();
let mut input = input.trim_start();
// Leading + is ignored for this.
if let Some(trimmed) = input.strip_prefix('+') {
input = trimmed;
}
let input = input.trim_start().strip_prefix('+').unwrap_or(&input);
// Integral digits for any hex number is ill-defined (0 is fine as an output)
// Fractional digits for an floating hex number is ill-defined, return None