Skip to content

Commit

Permalink
chore(lib): fix new unused variable lint
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Feb 18, 2021
1 parent f605125 commit 6d9003d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,22 +173,21 @@ impl<F, R> fmt::Debug for ServiceFnOk<F, R> {
}
}

//#[cfg(test)]
fn _assert_fn_mut() {
fn assert_service<T: Service>(_t: &T) {}

let mut val = 0;

let svc = service_fn(move |_req: Request<::Body>| {
val += 1;
future::ok::<_, Never>(Response::new(::Body::empty()))
future::ok::<_, Never>(Response::new(::Body::from(val.to_string())))
});

assert_service(&svc);

let svc = service_fn_ok(move |_req: Request<::Body>| {
val += 1;
Response::new(::Body::empty())
Response::new(::Body::from(val.to_string()))
});

assert_service(&svc);
Expand Down

0 comments on commit 6d9003d

Please sign in to comment.