Skip to content

Commit

Permalink
chore(sync): short form
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Dec 25, 2023
1 parent 661587f commit e7c4549
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ where
}

// yields `Field`
let mut field = Field::<T>::empty();
let mut field = Field::empty();

field.name = name;
field.filename = filename;
Expand Down
7 changes: 5 additions & 2 deletions src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ where
// invalid content disposition
let Some((name, filename)) = headers
.remove(CONTENT_DISPOSITION)
.and_then(|v| parse_content_disposition(v.as_bytes()).ok())
.as_ref()
.map(HeaderValue::as_bytes)
.map(parse_content_disposition)
.and_then(Result::ok)
else {
return Some(Err(Error::InvalidContentDisposition));
};
Expand All @@ -246,7 +249,7 @@ where
}

// yields `Field`
let mut field = Field::<T>::empty();
let mut field = Field::empty();

field.name = name;
field.filename = filename;
Expand Down

0 comments on commit e7c4549

Please sign in to comment.