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

Function read_marshal_name_tuple

crates/compiler-core/src/marshal.rs:316–330  ·  view source on GitHub ↗
(
    rdr: &mut R,
    bag: &Bag,
)

Source from the content-addressed store, hash-verified

314}
315
316fn read_marshal_name_tuple<R: Read, Bag: ConstantBag>(
317 rdr: &mut R,
318 bag: &Bag,
319) -> Result<Box<[<Bag::Constant as Constant>::Name]>> {
320 let type_byte = rdr.read_u8()? & !FLAG_REF;
321 let n = match type_byte {
322 b'(' => rdr.read_u32()? as usize,
323 b')' => rdr.read_u8()? as usize,
324 _ => return Err(MarshalError::BadType),
325 };
326 (0..n)
327 .map(|_| Ok(bag.make_name(&read_marshal_str(rdr)?)))
328 .collect::<Result<Vec<_>>>()
329 .map(Vec::into_boxed_slice)
330}
331
332/// Read a marshal tuple of constants.
333fn read_marshal_const_tuple<R: Read, Bag: ConstantBag>(

Callers 1

deserialize_codeFunction · 0.85

Calls 6

read_marshal_strFunction · 0.85
read_u8Method · 0.80
read_u32Method · 0.80
ErrClass · 0.50
mapMethod · 0.45
make_nameMethod · 0.45

Tested by

no test coverage detected