mirror of
https://github.com/actix/actix-web.git
synced 2024-11-03 15:39:50 +00:00
use write instead format
This commit is contained in:
parent
86e44de787
commit
8e462c5944
1 changed files with 5 additions and 5 deletions
|
@ -1,9 +1,10 @@
|
|||
#![cfg_attr(feature = "cargo-clippy", allow(redundant_field_names))]
|
||||
// #![cfg_attr(feature = "cargo-clippy", allow(redundant_field_names))]
|
||||
|
||||
use std::io::{self, Write};
|
||||
use std::rc::Rc;
|
||||
|
||||
use bytes::{BufMut, BytesMut};
|
||||
use futures::{Async, Poll};
|
||||
use std::io;
|
||||
use std::rc::Rc;
|
||||
use tokio_io::AsyncWrite;
|
||||
|
||||
use super::helpers;
|
||||
|
@ -178,9 +179,8 @@ impl<T: AsyncWrite, H: 'static> Writer for H1Writer<T, H> {
|
|||
helpers::write_content_length(len, &mut buffer)
|
||||
}
|
||||
ResponseLength::Length64(len) => {
|
||||
let s = format!("{}", len);
|
||||
buffer.extend_from_slice(b"\r\ncontent-length: ");
|
||||
buffer.extend_from_slice(s.as_ref());
|
||||
write!(buffer.writer(), "{}", len)?;
|
||||
buffer.extend_from_slice(b"\r\n");
|
||||
}
|
||||
ResponseLength::None => buffer.extend_from_slice(b"\r\n"),
|
||||
|
|
Loading…
Reference in a new issue