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

Function parse_precision

crates/common/src/cformat.rs:674–685  ·  view source on GitHub ↗
(iter: &mut ParseIter<I>)

Source from the content-addressed store, hash-verified

672}
673
674fn parse_precision<C, I>(iter: &mut ParseIter<I>) -> Result<Option<CFormatPrecision>, ParsingError>
675where
676 C: FormatChar,
677 I: Iterator<Item = C>,
678{
679 if iter.next_if(|(_, c)| c.eq_char('.')).is_some() {
680 let quantity = parse_quantity(iter)?;
681 let precision = quantity.map_or(CFormatPrecision::Dot, CFormatPrecision::Quantity);
682 return Ok(Some(precision));
683 }
684 Ok(None)
685}
686
687fn parse_text_inside_parentheses<T, I>(iter: &mut ParseIter<I>) -> Option<T>
688where

Callers 1

parseMethod · 0.70

Calls 3

parse_quantityFunction · 0.85
eq_charMethod · 0.80
SomeClass · 0.50

Tested by

no test coverage detected