MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / read_int

Method read_int

std/re/src/main/parser.rs:119–127  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

117 }
118
119 fn read_int(&mut self) -> Option<usize> {
120 let start = self.pos;
121 let mut n: usize = 0;
122 while let Some(d) = self.peek().and_then(|c| c.to_digit(10)) {
123 n = n.saturating_mul(10).saturating_add(d as usize);
124 self.bump();
125 }
126 if self.pos == start { None } else { Some(n) }
127 }
128
129 fn atom(&mut self) -> Result<Node, ParseError> {
130 match self.peek() {

Callers 1

try_boundMethod · 0.80

Calls 2

bumpMethod · 0.80
peekMethod · 0.45

Tested by

no test coverage detected