Fix typos in service docs (#74)

This commit fixes some typos and improves the grammar/structure
of some sections.
This commit is contained in:
jtroo 2021-08-01 11:55:09 -07:00 committed by GitHub
parent 2cf28c6794
commit 10bedca796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,8 +28,8 @@
//! //!
//! Generally routing to one of multiple services and backpressure doesn't mix //! Generally routing to one of multiple services and backpressure doesn't mix
//! well. Ideally you would want ensure a service is ready to receive a request //! well. Ideally you would want ensure a service is ready to receive a request
//! before calling the it. However in order to know which service to call you //! before calling it. However, in order to know which service to call, you need
//! need the request... //! the request...
//! //!
//! One approach is to not consider the router service itself ready until all //! One approach is to not consider the router service itself ready until all
//! destination services are ready. That is the approach used by //! destination services are ready. That is the approach used by
@ -47,10 +47,10 @@
//! about backpressure. At the very least you should [load shed] so requests are //! about backpressure. At the very least you should [load shed] so requests are
//! dropped quickly and don't keep piling up. //! dropped quickly and don't keep piling up.
//! //!
//! It also means if `poll_ready` returns an error that error will be returned //! It also means that if `poll_ready` returns an error then that error will be
//! in the response future from `call`, and _not_ from `poll_ready`. In that //! returned in the response future from `call` and _not_ from `poll_ready`. In
//! case the underlying service will _not_ be discarded and will continue to be //! that case, the underlying service will _not_ be discarded and will continue
//! used for future requests. Services that expect to be discarded if //! to be used for future requests. Services that expect to be discarded if
//! `poll_ready` fails should _not_ be used with axum. //! `poll_ready` fails should _not_ be used with axum.
//! //!
//! One possible approach is to only apply backpressure sensitive middleware //! One possible approach is to only apply backpressure sensitive middleware
@ -539,7 +539,7 @@ pub trait ServiceExt<ReqBody, ResBody>:
/// ///
/// `handle_error` takes a closure that will map errors from the service /// `handle_error` takes a closure that will map errors from the service
/// into responses. The closure's return type must be `Result<T, E>` where /// into responses. The closure's return type must be `Result<T, E>` where
/// `T` implements [`IntoIntoResponse`](crate::response::IntoResponse). /// `T` implements [`IntoResponse`](crate::response::IntoResponse).
/// ///
/// # Example /// # Example
/// ///
@ -586,7 +586,7 @@ pub trait ServiceExt<ReqBody, ResBody>:
/// Check that your service cannot fail. /// Check that your service cannot fail.
/// ///
/// That is its error type is [`Infallible`]. /// That is, its error type is [`Infallible`].
fn check_infallible(self) -> Self fn check_infallible(self) -> Self
where where
Self: Service<Request<ReqBody>, Response = Response<ResBody>, Error = Infallible> + Sized, Self: Service<Request<ReqBody>, Response = Response<ResBody>, Error = Infallible> + Sized,