Lines Matching refs:bytes
50 fn parse_sign<'a>(bytes: &'a [u8]) -> (bool, &'a [u8]) { in parse_sign()
51 match bytes.get(0) { in parse_sign()
52 Some(&b'+') => (true, &bytes[1..]), in parse_sign()
53 Some(&b'-') => (false, &bytes[1..]), in parse_sign()
54 _ => (true, bytes), in parse_sign()
103 fn ltrim_zero<'a>(bytes: &'a [u8]) -> &'a [u8] { in ltrim_zero()
104 let count = bytes.iter().take_while(|&&si| si == b'0').count(); in ltrim_zero()
105 &bytes[count..] in ltrim_zero()
110 fn rtrim_zero<'a>(bytes: &'a [u8]) -> &'a [u8] { in rtrim_zero()
111 let count = bytes.iter().rev().take_while(|&&si| si == b'0').count(); in rtrim_zero()
112 let index = bytes.len() - count; in rtrim_zero()
113 &bytes[..index] in rtrim_zero()
151 fn parse_float<'a, F>(bytes: &'a [u8]) -> (F, &'a [u8]) in parse_float()
156 let (is_positive, bytes) = parse_sign(bytes); in parse_float()
166 let (integer_slc, bytes) = consume_digits(bytes); in parse_float()
167 let (fraction_slc, bytes) = match bytes.first() { in parse_float()
168 Some(&b'.') => consume_digits(&bytes[1..]), in parse_float()
169 _ => (&bytes[..0], bytes), in parse_float()
171 let (exponent, bytes) = match bytes.first() { in parse_float()
174 let (is_positive, bytes) = parse_sign(&bytes[1..]); in parse_float()
175 let (exponent, bytes) = consume_digits(bytes); in parse_float()
176 (parse_exponent(exponent, is_positive), bytes) in parse_float()
178 _ => (0, bytes), in parse_float()
203 (float, bytes) in parse_float()