fix(api): minor fixes

* Mime crate must be used in the same version hyper uses
* made attempted move a borrow
This commit is contained in:
Sebastian Thiel
2015-06-19 11:41:29 +02:00
parent 5483e32832
commit 2ad8d887cd
2 changed files with 4 additions and 3 deletions

View File

@@ -25,7 +25,8 @@ name = "${util.program_name()}"
[dependencies]
hyper = ">= 0.5.2"
mime = "*"
## Must match the one hyper uses, otherwise there are duplicate similarly named `Mime` structs
mime = "0.0.11"
serde = ">= 0.4.1"
yup-oauth2 = "*"
% for dep in cargo.get('dependencies', list()):

View File

@@ -595,8 +595,8 @@ impl Header for RangeResponseHeader {
fn parse_header(raw: &[Vec<u8>]) -> Option<Self> {
if raw.len() > 0 {
let v = raw[0];
if let Ok(s) = std::str::from_utf8(&v) {
let v = &raw[0];
if let Ok(s) = std::str::from_utf8(v) {
const PREFIX: &'static str = "bytes ";
if s.starts_with(PREFIX) {
if let Ok(c) = <Chunk as FromStr>::from_str(&s[PREFIX.len()..]) {