mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
seq: Simplify leading + handling
Address review comment.
This commit is contained in:
committed by
Daniel Hofstetter
parent
27efb9eff4
commit
04a12820bb
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user