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

Function get_num_digits

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

Source from the content-addressed store, hash-verified

229}
230
231fn get_num_digits(text: &Wtf8) -> usize {
232 for (index, character) in text.code_point_indices() {
233 if !character.is_char_and(|c| c.is_ascii_digit()) {
234 return index;
235 }
236 }
237 text.len()
238}
239
240fn parse_fill_and_align(text: &Wtf8) -> (Option<CodePoint>, Option<FormatAlign>, &Wtf8) {
241 let char_indices: Vec<(usize, CodePoint)> = text.code_point_indices().take(3).collect();

Callers 1

parse_numberFunction · 0.85

Calls 3

code_point_indicesMethod · 0.80
is_char_andMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected