Return the number of distinct characters represented by all of the ranges.
(&self)
| 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. |