/// Try to return an arbitrary header as u32
Try to return an arbitrary header as u32
Try to return an arbitrary header as u32
fn header_as_number(name: &str, resp: &reqwest::blocking::Response) -> Result<u32> {
    let header = resp.headers()
                     .get(name)
                     .ok_or_else(|| Error::from(format!("Response missing the {} header", name)))?
                     .to_str()?;
    let num = header.parse()
                    .chain_err(|| format!("Could not parse {} header", name))?;
    Ok(num)
}
fn header_as_number ( name : & str , resp : & reqwest :: blocking :: Response ) -> Result < u32 > { let header = resp . headers ( ) . get ( name ) . ok_or_else ( | | Error :: from ( format ! ( " " name ) ) ) ? . to_str ( ) ? ; let num = header . parse ( ) . chain_err ( | | format ! ( " " name ) ) ? ; Ok ( num ) }
Try to return an arbitrary header as u32
Try to return an arbitrary header as u32
name
&str
resp
&reqwest::blocking::Response