mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
seq: Simplify leading + handling
Address review comment.
This commit is contained in:
parent
27efb9eff4
commit
04a12820bb
1 changed files with 1 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue