fn decode_vec<T: Decodable>(decoder: &mut Decoder<'_>, vec: &mut Vec<T>) -> Result<bool> {
    let mut len: u64 = 0;
    len.decode(decoder)?;

    let mut present: u64 = 0;
    present.decode(decoder)?;

    match present {
        ALLOC_ABSENT_U64 => {
            return if len == 0 { Ok(false) } else { Err(Error::UnexpectedNullRef) }
        }
        ALLOC_PRESENT_U64 => {}
        _ => return Err(Error::Invalid),
    }

    let len = len as usize;
    let bytes_len = len * decoder.inline_size_of::<T>();
    decoder.read_out_of_line(bytes_len, |decoder| {
        decoder.recurse(|decoder| {
            vec.truncate(0);
            for _ in 0..len {
                vec.push(T::new_empty());
                // We just pushed an element on, so the `unwrap` will succeed.
                vec.last_mut().unwrap().decode(decoder)?;
            }
            Ok(true)
        })
    })
}
/// Attempts to decode a vec into `vec`, returning a `bool`
/// indicating whether or not a vec was present.
Attempts to decode a vec into `vec`, returning a `bool`
indicating whether or not a vec was present.
Attempts to decode a vec into ` vec ` returning a ` bool ` indicating whether or not a vec was present .
fn decode_vec<T: Decodable>(decoder: &mut Decoder<'_>, vec: &mut Vec<T>) -> Result<bool> {
    let mut len: u64 = 0;
    len.decode(decoder)?;
    let mut present: u64 = 0;
    present.decode(decoder)?;
    match present {
        ALLOC_ABSENT_U64 => {
            return if len == 0 { Ok(false) } else { Err(Error::UnexpectedNullRef) }
        }
        ALLOC_PRESENT_U64 => {}
        _ => return Err(Error::Invalid),
    }
    let len = len as usize;
    let bytes_len = len * decoder.inline_size_of::<T>();
    decoder.read_out_of_line(bytes_len, |decoder| {
        decoder.recurse(|decoder| {
            vec.truncate(0);
            for _ in 0..len {
                vec.push(T::new_empty());
                // We just pushed an element on, so the `unwrap` will succeed.
                vec.last_mut().unwrap().decode(decoder)?;
            }
            Ok(true)
        })
    })
}
fn decode_vec < T : Decodable > ( decoder : & mut Decoder < ' _ > , vec : & mut Vec < T > ) -> Result < bool > { let mut len : u64 = 0 ; len . decode ( decoder ) ? ; let mut present : u64 = 0 ; present . decode ( decoder ) ? ; match present { ALLOC_ABSENT_U64 => { return if len == 0 { Ok ( false ) } else { Err ( Error :: UnexpectedNullRef ) } } ALLOC_PRESENT_U64 => { } _ => return Err ( Error :: Invalid ) , } let len = len as usize ; let bytes_len = len * decoder . inline_size_of :: < T > ( ) ; decoder . read_out_of_line ( bytes_len , | decoder | { decoder . recurse ( | decoder | { vec . truncate ( 0 ) ; for _ in 0 .. len { vec . push ( T :: new_empty ( ) ) ; // We just pushed an element on, so the `unwrap` will succeed. vec . last_mut ( ) . unwrap ( ) . decode ( decoder ) ? ; } Ok ( true ) } ) } ) }
Attempts to decode a vec into `vec`, returning a `bool`
indicating whether or not a vec was present.
Attempts to decode a vec into ` vec ` returning a ` bool ` indicating whether or not a vec was present .
decoder
&mut Decoder<'_>
vec
&mut Vec<T>