Skip to content

Commit 6d26ee0

Browse files
author
Allan
authored
docs(service): minor language fixes to Service::call (#3449)
1 parent 6a57d64 commit 6d26ee0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/service/service.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ pub trait Service<Request> {
2828
type Future: Future<Output = Result<Self::Response, Self::Error>>;
2929

3030
/// Process the request and return the response asynchronously.
31-
/// call takes a &self instead of a mut &self because:
31+
/// `call` takes `&self` instead of `mut &self` because:
3232
/// - It prepares the way for async fn,
33-
/// since then the future only borrows &self, and thus a Service can concurrently handle
33+
/// since then the future only borrows `&self`, and thus a Service can concurrently handle
3434
/// multiple outstanding requests at once.
3535
/// - It's clearer that Services can likely be cloned
36-
/// - To share state across clones you generally need Arc<Mutex<_>>
37-
/// that means you're not really using the &mut self and could do with a &self
38-
/// To see the discussion on this see: <https://github.com/hyperium/hyper/issues/3040>
36+
/// - To share state across clones, you generally need `Arc<Mutex<_>>`
37+
/// That means you're not really using the `&mut self` and could do with a `&self`.
38+
/// The discussion on this is here: <https://github.com/hyperium/hyper/issues/3040>
3939
fn call(&self, req: Request) -> Self::Future;
4040
}

0 commit comments

Comments
 (0)