MCPcopy Index your code
hub / github.com/RustPython/RustPython / parse_zero

Function parse_zero

crates/common/src/format.rs:279–285  ·  view source on GitHub ↗
(text: &Wtf8)

Source from the content-addressed store, hash-verified

277}
278
279fn parse_zero(text: &Wtf8) -> (bool, &Wtf8) {
280 let mut chars = text.code_points();
281 match chars.next().and_then(CodePoint::to_char) {
282 Some('0') => (true, chars.as_wtf8()),
283 _ => (false, text),
284 }
285}
286
287fn parse_precision(text: &Wtf8) -> Result<(Option<usize>, &Wtf8), FormatSpecError> {
288 let mut chars = text.code_points();

Callers 1

_parseMethod · 0.85

Calls 3

code_pointsMethod · 0.80
nextMethod · 0.45
as_wtf8Method · 0.45

Tested by

no test coverage detected