style(rustfmt): run rustfmt on hyper correct overlong lines
This commit is contained in:
@@ -77,4 +77,3 @@ impl<T: Send + 'static> Drop for Sentinel<T> {
|
||||
let _ = self.supervisor.send(self.value.take().unwrap());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,8 @@ impl<L: NetworkListener + Send + 'static> Server<L> {
|
||||
}
|
||||
/// Binds to a socket and starts handling connections with the provided
|
||||
/// number of threads.
|
||||
pub fn handle_threads<H: Handler + 'static>(self, handler: H, threads: usize) -> ::Result<Listening> {
|
||||
pub fn handle_threads<H: Handler + 'static>(self, handler: H,
|
||||
threads: usize) -> ::Result<Listening> {
|
||||
with_listener(handler, self.listener, threads)
|
||||
}
|
||||
}
|
||||
@@ -232,7 +233,8 @@ impl<'a, H: Handler + 'static> Worker<'a, H> {
|
||||
debug!("keep_alive loop ending for {}", addr);
|
||||
}
|
||||
|
||||
fn keep_alive_loop<W: Write>(&self, mut rdr: BufReader<&mut NetworkStream>, mut wrt: W, addr: SocketAddr) {
|
||||
fn keep_alive_loop<W: Write>(&self, mut rdr: BufReader<&mut NetworkStream>,
|
||||
mut wrt: W, addr: SocketAddr) {
|
||||
let mut keep_alive = true;
|
||||
while keep_alive {
|
||||
let req = match Request::new(&mut rdr, addr) {
|
||||
@@ -277,7 +279,7 @@ impl<'a, H: Handler + 'static> Worker<'a, H> {
|
||||
|
||||
debug!("keep_alive = {:?} for {}", keep_alive, addr);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
fn handle_expect<W: Write>(&self, req: &Request, wrt: &mut W) -> bool {
|
||||
|
||||
@@ -81,7 +81,8 @@ impl<'a, W: Any> Response<'a, W> {
|
||||
|
||||
fn write_head(&mut self) -> io::Result<Body> {
|
||||
debug!("writing head: {:?} {:?}", self.version, self.status);
|
||||
try!(write!(&mut self.body, "{} {}{}{}", self.version, self.status, CR as char, LF as char));
|
||||
try!(write!(&mut self.body, "{} {}{}{}", self.version, self.status,
|
||||
CR as char, LF as char));
|
||||
|
||||
if !self.headers.has::<header::Date>() {
|
||||
self.headers.set(header::Date(header::HttpDate(now_utc())));
|
||||
@@ -123,7 +124,8 @@ impl<'a, W: Any> Response<'a, W> {
|
||||
impl<'a> Response<'a, Fresh> {
|
||||
/// Creates a new Response that can be used to write to a network stream.
|
||||
#[inline]
|
||||
pub fn new(stream: &'a mut (Write + 'a), headers: &'a mut header::Headers) -> Response<'a, Fresh> {
|
||||
pub fn new(stream: &'a mut (Write + 'a), headers: &'a mut header::Headers) ->
|
||||
Response<'a, Fresh> {
|
||||
Response {
|
||||
status: status::StatusCode::Ok,
|
||||
version: version::HttpVersion::Http11,
|
||||
@@ -168,7 +170,8 @@ impl<'a> Response<'a, Fresh> {
|
||||
stream.end()
|
||||
}
|
||||
|
||||
/// Consume this Response<Fresh>, writing the Headers and Status and creating a Response<Streaming>
|
||||
/// Consume this Response<Fresh>, writing the Headers and Status and
|
||||
/// creating a Response<Streaming>
|
||||
pub fn start(mut self) -> io::Result<Response<'a, Streaming>> {
|
||||
let body_type = try!(self.write_head());
|
||||
let (version, body, status, headers) = self.deconstruct();
|
||||
|
||||
Reference in New Issue
Block a user