Skip to content

Commit

Permalink
chore(docs): fix typo in middleware guide (#141)
Browse files Browse the repository at this point in the history
* chore(docs): fix typo

* Update middleware.md
  • Loading branch information
EstebanBorai authored Oct 2, 2024
1 parent 62a6f66 commit 75ed75e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _stable/server/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let (stream, _) = listener.accept().await?;
let io = TokioIo::new(stream);
tokio::spawn(async move {
// N.B. should use tower service_fn here, since it's reuqired to be implemented tower Service trait before convert to hyper Service!
// N.B. should use tower service_fn here, since it's required to be implemented tower Service trait before convert to hyper Service!
let svc = tower::service_fn(hello);
let svc = ServiceBuilder::new().layer_fn(Logger::new).service(svc);
// Convert it to hyper service
Expand All @@ -244,10 +244,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
});
}
}
}

# fn main() {}
```

[hellp-world]: {{ site.url }}/guides/1/server/hello-world/
[upgrading]: {{ site.url }}/guides/1/upgrading/
[adapter-trait]: {{ site.hyper_util_url }}/latest/hyper_util/service/struct.TowerToHyperService.html
[adapter-trait]: {{ site.hyper_util_url }}/latest/hyper_util/service/struct.TowerToHyperService.html

0 comments on commit 75ed75e

Please sign in to comment.