MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / parse_number

Function parse_number

src/debug_utils/generic_reginfo/parse.rs:44–50  ·  view source on GitHub ↗
(pair: Pair<'_, Rule>)

Source from the content-addressed store, hash-verified

42}
43
44fn parse_number<T: FromStr>(pair: Pair<'_, Rule>) -> Result<T> {
45 Ok(pair.as_str().parse().map_err(|_| {
46 // This can only fail due to integer overflow, the rule only allows
47 // digits.
48 custom_error(pair.as_span(), "integer overflow")
49 })?)
50}
51
52fn parse_entity<T: EntityRef>(pair: Pair<'_, Rule>) -> Result<T> {
53 let [number] = extract(pair, [Rule::number]);

Callers 3

parse_entityFunction · 0.70
parse_class_defFunction · 0.70
parse_bank_defFunction · 0.70

Calls 2

custom_errorFunction · 0.70
parseMethod · 0.45

Tested by

no test coverage detected