remove superfluous is_float variable
This commit is contained in:
parent
bc09e49c89
commit
03316161a8
@ -69,18 +69,16 @@ pub(crate) fn eat_number<I: Iterator<Item = Token>>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut dec = String::new();
|
let mut dec = String::new();
|
||||||
let mut is_float = false;
|
|
||||||
|
|
||||||
let next_tok = *toks.peek().unwrap();
|
let next_tok = *toks.peek().unwrap();
|
||||||
|
|
||||||
if next_tok.kind == '.' {
|
if next_tok.kind == '.' {
|
||||||
toks.next();
|
toks.next();
|
||||||
is_float = true;
|
|
||||||
eat_whole_number(toks, &mut dec);
|
eat_whole_number(toks, &mut dec);
|
||||||
}
|
|
||||||
|
|
||||||
if dec.is_empty() && is_float {
|
if dec.is_empty() {
|
||||||
return Err(("Expected digit.", next_tok.pos()).into());
|
return Err(("Expected digit.", next_tok.pos()).into());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut times_ten = String::new();
|
let mut times_ten = String::new();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user