From 0ae1bdb3e7d7738fdf5332af82f714a0cac2bc90 Mon Sep 17 00:00:00 2001 From: mos Date: Sat, 27 Jul 2024 17:00:29 +0200 Subject: [PATCH] fix signed parsing --- bip/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bip/src/lib.rs b/bip/src/lib.rs index c597544..a5d0bdf 100644 --- a/bip/src/lib.rs +++ b/bip/src/lib.rs @@ -112,12 +112,10 @@ impl Symbol { let v = Symbol::take(&mut it, |c| c.is_numeric()); if let Ok(n) = v.iter().collect::().parse::() { - let n = (n as i64 * sign) as u64; - syms.push(if sign > 0 { Self::Int(n) } else { - Self::SInt(n) + Self::SInt((n as i64 * sign) as u64) }); } else { return Err("invalid integer".to_string());