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

Function create_format_part

crates/vm/src/stdlib/_string.rs:21–35  ·  view source on GitHub ↗
(
        literal: Wtf8Buf,
        field_name: Option<Wtf8Buf>,
        format_spec: Option<Wtf8Buf>,
        conversion_spec: Option<CodePoint>,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

19 use core::mem;
20
21 fn create_format_part(
22 literal: Wtf8Buf,
23 field_name: Option<Wtf8Buf>,
24 format_spec: Option<Wtf8Buf>,
25 conversion_spec: Option<CodePoint>,
26 vm: &VirtualMachine,
27 ) -> PyObjectRef {
28 let tuple = (
29 literal,
30 field_name,
31 format_spec,
32 conversion_spec.map(|c| c.to_string()),
33 );
34 tuple.to_pyobject(vm)
35 }
36
37 #[pyfunction]
38 fn formatter_parser(text: PyStrRef, vm: &VirtualMachine) -> PyResult<PyList> {

Callers 1

formatter_parserFunction · 0.85

Calls 3

to_stringMethod · 0.80
mapMethod · 0.45
to_pyobjectMethod · 0.45

Tested by

no test coverage detected