MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / p_cpu_range

Function p_cpu_range

crates/hyperqueue/src/worker/hwdetect.rs:267–279  ·  view source on GitHub ↗
(input: &str)

Source from the content-addressed store, hash-verified

265}
266
267fn p_cpu_range(input: &str) -> NomResult<'_, Vec<ResourceIndex>> {
268 map_res(
269 tuple((
270 terminated(p_u32, space0),
271 opt(terminated(
272 preceded(tuple((tag("-"), space0)), p_u32),
273 space0,
274 )),
275 )),
276 |(u, v)| crate::Result::Ok((u..=v.unwrap_or(u)).map(|id| id.into()).collect()),
277 )
278 .parse(input)
279}
280
281fn p_cpu_ranges(input: &str) -> NomResult<'_, Vec<ResourceIndex>> {
282 separated_list1(terminated(tag(","), space0), p_cpu_range)(input)

Callers

nothing calls this directly

Calls 2

parseMethod · 0.80
intoMethod · 0.80

Tested by

no test coverage detected