Get a single raw header value for type `T` using its default value when str::parse failed
(raw_data: &HttpHeaderType, key: &str)
| 56 | /// Get a single raw header value for type `T` |
| 57 | /// using its default value when str::parse failed |
| 58 | fn get_single_header_value<T>(raw_data: &HttpHeaderType, key: &str) -> T where T: Default + FromStr { |
| 59 | match str::parse(&raw_data[key][0]) { |
| 60 | Ok(x) => x, |
| 61 | Err(..) => Default::default(), |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | impl Populatable for Rate { |
| 66 | /// `populate` a `Rate<T>` object from the HTTP response header |