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

Function format_map

crates/vm/src/format.rs:222–233  ·  view source on GitHub ↗
(
    format: &FormatString,
    dict: &PyObject,
    vm: &VirtualMachine,
)

Source from the content-addressed store, hash-verified

220}
221
222pub(crate) fn format_map(
223 format: &FormatString,
224 dict: &PyObject,
225 vm: &VirtualMachine,
226) -> PyResult<Wtf8Buf> {
227 format_internal(vm, format, &mut |field_type| match field_type {
228 FieldType::Auto | FieldType::Index(_) => {
229 Err(vm.new_value_error("Format string contains positional fields"))
230 }
231 FieldType::Keyword(keyword) => dict.get_item(&keyword, vm),
232 })
233}

Callers 1

format_mapMethod · 0.85

Calls 3

format_internalFunction · 0.85
ErrClass · 0.50
get_itemMethod · 0.45

Tested by

no test coverage detected