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

Function parse_number

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

Source from the content-addressed store, hash-verified

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

Callers 3

parse_entityFunction · 0.70
parse_block_labelFunction · 0.70
parse_constraintFunction · 0.70

Calls 2

custom_errorFunction · 0.70
parseMethod · 0.45

Tested by

no test coverage detected