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

Method insert_separator

crates/common/src/format.rs:406–412  ·  view source on GitHub ↗
(mut magnitude_str: String, inter: i32, sep: char, sep_cnt: i32)

Source from the content-addressed store, hash-verified

404 }
405
406 fn insert_separator(mut magnitude_str: String, inter: i32, sep: char, sep_cnt: i32) -> String {
407 let magnitude_len = magnitude_str.len() as i32;
408 for i in 1..=sep_cnt {
409 magnitude_str.insert((magnitude_len - inter * i) as usize, sep);
410 }
411 magnitude_str
412 }
413
414 fn validate_format(&self, default_format_type: FormatType) -> Result<(), FormatSpecError> {
415 let format_type = self.format_type.as_ref().unwrap_or(&default_format_type);

Callers

nothing calls this directly

Calls 2

lenMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected