1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-27 10:39:03 +02:00

use custom headers map; more optimizations

This commit is contained in:
Nikolay Kim
2019-04-06 15:02:02 -07:00
parent 4ef46e26f9
commit 748289f0ff
35 changed files with 668 additions and 180 deletions

View File

@ -209,7 +209,7 @@ where
};
let mut len = None;
if let Some(l) = req.headers().get(CONTENT_LENGTH) {
if let Some(l) = req.headers().get(&CONTENT_LENGTH) {
if let Ok(s) = l.to_str() {
if let Ok(l) = s.parse::<usize>() {
len = Some(l)

View File

@ -297,7 +297,7 @@ where
}
let mut len = None;
if let Some(l) = req.headers().get(CONTENT_LENGTH) {
if let Some(l) = req.headers().get(&CONTENT_LENGTH) {
if let Ok(s) = l.to_str() {
if let Ok(l) = s.parse::<usize>() {
len = Some(l)

View File

@ -313,7 +313,7 @@ where
/// Create `MessageBody` for request.
pub fn new(req: &mut T) -> HttpMessageBody<T> {
let mut len = None;
if let Some(l) = req.headers().get(header::CONTENT_LENGTH) {
if let Some(l) = req.headers().get(&header::CONTENT_LENGTH) {
if let Ok(s) = l.to_str() {
if let Ok(l) = s.parse::<usize>() {
len = Some(l)