MCPcopy Create free account
hub / github.com/davidblewett/rure-python / num_chars

Method num_chars

regex/src/prog.rs:398–403  ·  view source on GitHub ↗

Return the number of distinct characters represented by all of the ranges.

(&self)

Source from the content-addressed store, hash-verified

396 /// Return the number of distinct characters represented by all of the
397 /// ranges.
398 pub fn num_chars(&self) -> usize {
399 self.ranges.iter()
400 .map(|&(s, e)| 1 + (e as u32) - (s as u32))
401 .fold(0, |acc, len| acc + len)
402 as usize
403 }
404}
405
406/// Representation of the Bytes instruction.

Callers

nothing calls this directly

Calls 2

mapMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected