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

Function write_string

crates/vm/src/buffer.rs:693–699  ·  view source on GitHub ↗
(buf: &mut [u8], data: &[u8])

Source from the content-addressed store, hash-verified

691}
692
693fn write_string(buf: &mut [u8], data: &[u8]) {
694 let len_from_data = core::cmp::min(data.len(), buf.len());
695 buf[..len_from_data].copy_from_slice(&data[..len_from_data]);
696 for byte in &mut buf[len_from_data..] {
697 *byte = 0
698 }
699}
700
701fn unpack_char(vm: &VirtualMachine, data: &[u8]) -> PyObjectRef {
702 vm.ctx.new_bytes(vec![data[0]]).into()

Callers 2

pack_stringFunction · 0.85
pack_pascalFunction · 0.85

Calls 2

minFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected