fn r_pylong<'a>(p: &mut RFile<'a, impl Read>) -> Result<'a, &'a BigInt> {
    #[allow(clippy::cast_possible_wrap)]
    let n = r_long(p)? as i32;
    if n == 0 {
        return Ok(p.arena.alloc(BigInt::zero()));
    };
    #[allow(clippy::cast_sign_loss)]
    let size = n.wrapping_abs() as u32;
    let mut digits = Vec::<u16>::with_capacity(size as usize);
    for _ in 0..size {
        let d = r_short(p)?;
        if d > (1 << 15) {
            return Err(Error::DigitOutOfRange { digit: d });
        }
        digits.push(d);
    }
    if digits[(size - 1) as usize] == 0 {
        return Err(Error::UnnormalizedLong.into());
    }
    Ok(p.arena.alloc(BigInt::from_biguint(
        utils::sign_of(&n),
        utils::biguint_from_pylong_digits(&digits),
    )))
}
// TODO: test
/// May misbehave on 16-bit platforms.
test
May misbehave on 16-bit platforms.
test May misbehave on 16 - bit platforms .
fn r_pylong<'a>(p: &mut RFile<'a, impl Read>) -> Result<'a, &'a BigInt> {
    #[allow(clippy::cast_possible_wrap)]
    let n = r_long(p)? as i32;
    if n == 0 {
        return Ok(p.arena.alloc(BigInt::zero()));
    };
    #[allow(clippy::cast_sign_loss)]
    let size = n.wrapping_abs() as u32;
    let mut digits = Vec::<u16>::with_capacity(size as usize);
    for _ in 0..size {
        let d = r_short(p)?;
        if d > (1 << 15) {
            return Err(Error::DigitOutOfRange { digit: d });
        }
        digits.push(d);
    }
    if digits[(size - 1) as usize] == 0 {
        return Err(Error::UnnormalizedLong.into());
    }
    Ok(p.arena.alloc(BigInt::from_biguint(
        utils::sign_of(&n),
        utils::biguint_from_pylong_digits(&digits),
    )))
}
fn r_pylong < ' a > ( p : & mut RFile < ' a , impl Read > ) -> Result < ' a , & ' a BigInt > { # [ allow ( clippy cast_possible_wrap ) ] let n = r_long ( p ) ? as i32 ; if n == 0 { return Ok ( p . arena . alloc ( BigInt :: zero ( ) ) ) ; } ; # [ allow ( clippy cast_sign_loss ) ] let size = n . wrapping_abs ( ) as u32 ; let mut digits = Vec :: < u16 > :: with_capacity ( size as usize ) ; for _ in 0 .. size { let d = r_short ( p ) ? ; if d > ( 1 << 15 ) { return Err ( Error :: DigitOutOfRange { digit : d } ) ; } digits . push ( d ) ; } if digits [ ( size - 1 ) as usize ] == 0 { return Err ( Error :: UnnormalizedLong . into ( ) ) ; } Ok ( p . arena . alloc ( BigInt :: from_biguint ( utils :: sign_of ( & n ) , utils :: biguint_from_pylong_digits ( & digits ) , ) ) ) }
TODO: test
May misbehave on 16-bit platforms.
TODO : test May misbehave on 16 - bit platforms .
p
&mut RFile<'a, impl Read>