Skip to content

Commit 7c2622a

Browse files
weihangloseanmonstar
authored andcommitted
docs(service): service_fn doc test to async/await
1 parent b3e337d commit 7c2622a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/service/service.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ pub trait Service {
4343
/// # Example
4444
///
4545
/// ```rust
46+
/// # #![feature(async_await)]
4647
/// use hyper::{Body, Request, Response, Version};
4748
/// use hyper::service::service_fn;
4849
///
49-
/// let service = service_fn(|req: Request<Body>| {
50+
/// let service = service_fn(|req: Request<Body>| async move{
5051
/// if req.version() == Version::HTTP_11 {
5152
/// Ok(Response::new(Body::from("Hello World")))
5253
/// } else {

0 commit comments

Comments
 (0)