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

Method zfill

crates/vm/src/builtins/str.rs:1288–1293  ·  view source on GitHub ↗
(&self, width: isize)

Source from the content-addressed store, hash-verified

1286
1287 #[pymethod]
1288 fn zfill(&self, width: isize) -> Wtf8Buf {
1289 unsafe {
1290 // SAFETY: this is safe-guaranteed because the original self.as_wtf8() is valid wtf8
1291 Wtf8Buf::from_bytes_unchecked(self.as_wtf8().py_zfill(width))
1292 }
1293 }
1294
1295 #[inline]
1296 fn _pad(

Callers

nothing calls this directly

Calls 2

py_zfillMethod · 0.80
as_wtf8Method · 0.45

Tested by

no test coverage detected