Skip to content

Commit d86fbc0

Browse files
committed
chore: improve code examples
1 parent 5122fe7 commit d86fbc0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl Handler for Application {
5151
);
5252

5353
// Create a Hyper Response and send it back to the middlewares chain
54-
Ok(Response::builder().body(Body::from("¡Hola!")).unwrap())
54+
Ok(Response::new(Body::from("¡Hola!")))
5555
}
5656
}
5757

@@ -110,7 +110,7 @@ async fn main() -> Result {
110110
handler.link_before(FirstMiddleware {});
111111
handler.link_after(SecondMiddleware {});
112112

113-
// 3. Create an Hyper service and set the current handler with its middlewares
113+
// 3. Create a Hyper service and set the current handler with its middlewares
114114
let service = Service::new(handler);
115115

116116
// 4. Finally just run server using the service already created

examples/server.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl Handler for Application {
3434
);
3535

3636
// Create a Hyper Response and send it back to the middlewares chain
37-
Ok(Response::builder().body(Body::from("¡Hola!")).unwrap())
37+
Ok(Response::new(Body::from("¡Hola!")))
3838
}
3939
}
4040

@@ -93,7 +93,7 @@ async fn main() -> Result {
9393
handler.link_before(FirstMiddleware {});
9494
handler.link_after(SecondMiddleware {});
9595

96-
// 3. Create an Hyper service and set the current handler with its middlewares
96+
// 3. Create a Hyper service and set the current handler with its middlewares
9797
let service = Service::new(handler);
9898

9999
// 4. Finally just run server using the service already created

0 commit comments

Comments
 (0)