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

Method format

crates/vm/src/builtins/str.rs:977–981  ·  view source on GitHub ↗
(&self, args: FuncArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

975
976 #[pymethod]
977 fn format(&self, args: FuncArgs, vm: &VirtualMachine) -> PyResult<Wtf8Buf> {
978 let format_str =
979 FormatString::from_str(self.as_wtf8()).map_err(|e| e.to_pyexception(vm))?;
980 format(&format_str, &args, vm)
981 }
982
983 #[pymethod]
984 fn format_map(&self, mapping: PyObjectRef, vm: &VirtualMachine) -> PyResult<Wtf8Buf> {

Callers

nothing calls this directly

Calls 3

formatFunction · 0.50
as_wtf8Method · 0.45
to_pyexceptionMethod · 0.45

Tested by

no test coverage detected