We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
service_fn
1 parent b3e337d commit 7c2622aCopy full SHA for 7c2622a
src/service/service.rs
@@ -43,10 +43,11 @@ pub trait Service {
43
/// # Example
44
///
45
/// ```rust
46
+/// # #![feature(async_await)]
47
/// use hyper::{Body, Request, Response, Version};
48
/// use hyper::service::service_fn;
49
-/// let service = service_fn(|req: Request<Body>| {
50
+/// let service = service_fn(|req: Request<Body>| async move{
51
/// if req.version() == Version::HTTP_11 {
52
/// Ok(Response::new(Body::from("Hello World")))
53
/// } else {
0 commit comments