fn decode_string(decoder: &mut Decoder<'_>, string: &mut String) -> 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;
    decoder.read_out_of_line(len, |decoder| {
        string.truncate(0);
        string.push_str(str::from_utf8(decoder.buf).map_err(|_| Error::Utf8Error)?);
        Ok(true)
    })
}
/// Attempts to decode a string into `string`, returning a `bool`
/// indicating whether or not a string was present.
Attempts to decode a string into `string`, returning a `bool`
indicating whether or not a string was present.
Attempts to decode a string into ` string ` returning a ` bool ` indicating whether or not a string was present .
fn decode_string(decoder: &mut Decoder<'_>, string: &mut String) -> 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;
    decoder.read_out_of_line(len, |decoder| {
        string.truncate(0);
        string.push_str(str::from_utf8(decoder.buf).map_err(|_| Error::Utf8Error)?);
        Ok(true)
    })
}
fn decode_string ( decoder : & mut Decoder < ' _ > , string : & mut String ) -> 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 ; decoder . read_out_of_line ( len , | decoder | { string . truncate ( 0 ) ; string . push_str ( str :: from_utf8 ( decoder . buf ) . map_err ( | _ | Error :: Utf8Error ) ? ) ; Ok ( true ) } ) }
Attempts to decode a string into `string`, returning a `bool`
indicating whether or not a string was present.
Attempts to decode a string into ` string ` returning a ` bool ` indicating whether or not a string was present .
decoder
&mut Decoder<'_>
string
&mut String