Parse 4-byte integer.
()
| 231 | |
| 232 | /// Parse 4-byte integer. |
| 233 | pub fn parse_u32() -> impl CharParser<u32> { |
| 234 | parse_integer_string().try_map(|p, span| { |
| 235 | p.parse::<u32>() |
| 236 | .map_err(|_| ParseError::custom(span, "Cannot parse as 4-byte unsigned integer")) |
| 237 | }) |
| 238 | } |
| 239 | |
| 240 | /// Parse int32 or float with FRACTIONS_MAX_DIGITS precision (e.g. "2", "3.3", "0.0001") |
| 241 | pub fn parse_resource_amount() -> impl CharParser<ResourceAmount> { |
no test coverage detected