[clippy 12/15] Name the predicate

This commit is contained in:
Andreas Nordal 2019-06-23 15:59:04 +02:00
parent 9be209faa2
commit e3f3a6678e

@ -115,7 +115,7 @@ pub fn common_str_cmd(
tri: Transition::Push(ext),
pre: i, len: 0, alt: None
});
} else if predlen(&|c|{c >= b'0' && c <= b'9'}, &horizon[i+1 ..]) > 1 {
} else if predlen(&is_decimal, &horizon[i+1 ..]) > 1 {
return CommonStrCmdResult::Err(UnsupportedSyntax {
typ: "Unsupported syntax: Syntactic pitfall",
ctx: horizon.to_owned(),
@ -209,3 +209,7 @@ fn pos_tailhazard(horizon: &[u8], end: u8) -> (usize, usize) {
}
(idlen, pos)
}
fn is_decimal(byte: u8) -> bool {
byte >= b'0' && byte <= b'9'
}