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

Method check_specifiers

crates/common/src/cformat.rs:743–758  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

741
742impl<S> CFormatStrOrBytes<S> {
743 pub fn check_specifiers(&self) -> Option<(usize, bool)> {
744 let mut count = 0;
745 let mut mapping_required = false;
746 for (_, part) in &self.parts {
747 if part.is_specifier() {
748 let has_key = part.has_key();
749 if count == 0 {
750 mapping_required = has_key;
751 } else if mapping_required != has_key {
752 return None;
753 }
754 count += 1;
755 }
756 }
757 Some((count, mapping_required))
758 }
759
760 #[inline]
761 pub fn iter(&self) -> impl Iterator<Item = &(usize, CFormatPart<S>)> {

Callers 2

cformat_bytesFunction · 0.80
cformat_stringFunction · 0.80

Calls 3

is_specifierMethod · 0.80
has_keyMethod · 0.80
SomeClass · 0.50

Tested by

no test coverage detected