File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 2323 tokio = { version = "1", features = ["full"] }
2424 http-body-util = "0.1"
2525 hyper-util = { version = "0.1", features = ["full"] }
26+ tower = { version = "0.4" }
2627EOF
2728 cargo build --manifest-path " $value /Cargo.toml"
2829 fi
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ Let's create a Logger middleware in [hello-world server](https://hyper.rs/guides
99
1010Add tower dependency first
1111
12- ``` rust
12+ ``` toml
1313[dependencies ]
1414hyper = { version = " 1" , features = [" full" ] }
1515tokio = { version = " 1" , features = [" full" ] }
1616http-body-util = " 0.1"
1717hyper-util = { version = " 0.1" , features = [" full" ] }
18- tower = { version = " 0.4.13 " } // here
18+ tower = { version = " 0.4" } // here
1919```
2020
2121## Option 1: Use hyper Service trait
@@ -143,7 +143,6 @@ use http_body_util::Full;
143143use hyper_util :: {rt :: TokioIo , service :: TowerToHyperService };
144144use tokio :: net :: TcpListener ;
145145use tower :: ServiceBuilder ;
146- use crate :: logger :: Logger as Logger ;
147146async fn hello (_ : Request <Incoming >) -> Result <Response <Full <Bytes >>, Infallible > {
148147 Ok (Response :: new (Full :: new (Bytes :: from (" Hello, World!" ))))
149148}
You can’t perform that action at this time.
0 commit comments