refactor(lib): update to 2018 edition

This commit is contained in:
Sean McArthur
2019-07-09 14:50:51 -07:00
parent 79ae89e066
commit da9b0319ef
37 changed files with 358 additions and 398 deletions

View File

@@ -3,7 +3,7 @@ use std::fmt;
use futures::{Async, Future, IntoFuture, Poll};
use body::Payload;
use crate::body::Payload;
use super::Service;
/// An asynchronous constructor of `Service`s.

View File

@@ -2,7 +2,7 @@ use std::error::Error as StdError;
use futures::{Async, Future, IntoFuture, Poll};
use body::Payload;
use crate::body::Payload;
use super::{MakeService, Service};
/// An asynchronous constructor of `Service`s.

View File

@@ -4,9 +4,9 @@ use std::marker::PhantomData;
use futures::{future, Async, Future, IntoFuture, Poll};
use body::Payload;
use common::Never;
use ::{Request, Response};
use crate::body::Payload;
use crate::common::Never;
use crate::{Request, Response};
/// An asynchronous function from `Request` to `Response`.
pub trait Service {
@@ -179,16 +179,16 @@ fn _assert_fn_mut() {
let mut val = 0;
let svc = service_fn(move |_req: Request<::Body>| {
let svc = service_fn(move |_req: Request<crate::Body>| {
val += 1;
future::ok::<_, Never>(Response::new(::Body::empty()))
future::ok::<_, Never>(Response::new(crate::Body::empty()))
});
assert_service(&svc);
let svc = service_fn_ok(move |_req: Request<::Body>| {
let svc = service_fn_ok(move |_req: Request<crate::Body>| {
val += 1;
Response::new(::Body::empty())
Response::new(crate::Body::empty())
});
assert_service(&svc);