pub fn decode_string<R>(base: Option<&str>, r: &mut Reader<R>) -> io::Result<String>
    where R: Read
{
    if r.read_bool()? {
        read_string(r)
    } else if let Some(base) = base {
            Ok(base.to_owned())
    } else {
        Err(io::Error::new(io::ErrorKind::InvalidInput, "Missing previous string state"))
    }
}
/// Decodes a `String` without having to allocate for the base
/// parameter.
///
/// Clones the base if the string is the same as before.
Decodes a `String` without having to allocate for the base
parameter.

Clones the base if the string is the same as before.
Decodes a ` String ` without having to allocate for the base parameter . Clones the base if the string is the same as before .
pub fn decode_string<R>(base: Option<&str>, r: &mut Reader<R>) -> io::Result<String>
    where R: Read
{
    if r.read_bool()? {
        read_string(r)
    } else if let Some(base) = base {
            Ok(base.to_owned())
    } else {
        Err(io::Error::new(io::ErrorKind::InvalidInput, "Missing previous string state"))
    }
}
pub fn decode_string < R > ( base : Option < & str > , r : & mut Reader < R > ) -> io :: Result < String > where R : Read { if r . read_bool ( ) ? { read_string ( r ) } else if let Some ( base ) = base { Ok ( base . to_owned ( ) ) } else { Err ( io :: Error :: new ( io :: ErrorKind :: InvalidInput , " " ) ) } }
Decodes a `String` without having to allocate for the base
parameter.
Decodes a ` String ` without having to allocate for the base parameter .
base
Option<&str>
r
&mut Reader<R>