mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-07 00:00:12 +02:00
Fix typos (#461)
This commit is contained in:
+1
-1
@@ -350,7 +350,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
```
|
```
|
||||||
- SSE:
|
- SSE:
|
||||||
- **added:** Add `response::sse::Sse`. This implements SSE using a response rather than a service ([#98](https://github.com/tokio-rs/axum/pull/98))
|
- **added:** Add `response::sse::Sse`. This implements SSE using a response rather than a service ([#98](https://github.com/tokio-rs/axum/pull/98))
|
||||||
- **changed:** Remove `axum::sse`. Its been replaced by `axum::response::sse` ([#98](https://github.com/tokio-rs/axum/pull/98))
|
- **changed:** Remove `axum::sse`. It has been replaced by `axum::response::sse` ([#98](https://github.com/tokio-rs/axum/pull/98))
|
||||||
|
|
||||||
Handler using SSE in 0.1:
|
Handler using SSE in 0.1:
|
||||||
```rust
|
```rust
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ pub use bytes::Bytes;
|
|||||||
|
|
||||||
/// A boxed [`Body`] trait object.
|
/// A boxed [`Body`] trait object.
|
||||||
///
|
///
|
||||||
/// This is used in axum as the response body type for applications. Its
|
/// This is used in axum as the response body type for applications. It's
|
||||||
/// necessary to unify multiple response bodies types into one.
|
/// necessary to unify multiple response bodies types into one.
|
||||||
pub type BoxBody = http_body::combinators::UnsyncBoxBody<Bytes, Error>;
|
pub type BoxBody = http_body::combinators::UnsyncBoxBody<Bytes, Error>;
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ let app = Router::new()
|
|||||||
.route(
|
.route(
|
||||||
// Any request to `/` goes to a service
|
// Any request to `/` goes to a service
|
||||||
"/",
|
"/",
|
||||||
// Services who's response body is not `axum::body::BoxBody`
|
// Services whose response body is not `axum::body::BoxBody`
|
||||||
// can be wrapped in `axum::service::any` (or one of the other routing filters)
|
// can be wrapped in `axum::service::any` (or one of the other routing filters)
|
||||||
// to have the response body mapped
|
// to have the response body mapped
|
||||||
service::any(service_fn(|_: Request<Body>| async {
|
service::any(service_fn(|_: Request<Body>| async {
|
||||||
|
|||||||
+1
-1
@@ -207,7 +207,7 @@
|
|||||||
//! tower = "<latest-version>"
|
//! tower = "<latest-version>"
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! The `"full"` feature for hyper and tokio isn't strictly necessary but its
|
//! The `"full"` feature for hyper and tokio isn't strictly necessary but it's
|
||||||
//! the easiest way to get started.
|
//! the easiest way to get started.
|
||||||
//!
|
//!
|
||||||
//! Note that [`hyper::Server`] is re-exported by axum so if thats all you need
|
//! Note that [`hyper::Server`] is re-exported by axum so if thats all you need
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ where
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert this router into a [`MakeService`], that is a [`Service`] who's
|
/// Convert this router into a [`MakeService`], that is a [`Service`] whose
|
||||||
/// response is another service.
|
/// response is another service.
|
||||||
///
|
///
|
||||||
/// This is useful when running your application with hyper's
|
/// This is useful when running your application with hyper's
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use tower_service::Service;
|
|||||||
|
|
||||||
/// How routes are stored inside a [`Router`](super::Router).
|
/// How routes are stored inside a [`Router`](super::Router).
|
||||||
///
|
///
|
||||||
/// You normally shouldn't need to care about this type. Its used in
|
/// You normally shouldn't need to care about this type. It's used in
|
||||||
/// [`Router::layer`](super::Router::layer).
|
/// [`Router::layer`](super::Router::layer).
|
||||||
pub struct Route<B = Body>(CloneBoxService<Request<B>, Response<BoxBody>, Infallible>);
|
pub struct Route<B = Body>(CloneBoxService<Request<B>, Response<BoxBody>, Infallible>);
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ async fn websocket(stream: WebSocket, state: Arc<AppState>) {
|
|||||||
// By splitting we can send and receive at the same time.
|
// By splitting we can send and receive at the same time.
|
||||||
let (mut sender, mut receiver) = stream.split();
|
let (mut sender, mut receiver) = stream.split();
|
||||||
|
|
||||||
// Username gets set in the receive loop, if its valid
|
// Username gets set in the receive loop, if it's valid.
|
||||||
let mut username = String::new();
|
let mut username = String::new();
|
||||||
|
|
||||||
// Loop until a text message is found.
|
// Loop until a text message is found.
|
||||||
|
|||||||
Reference in New Issue
Block a user