From b847eb3cdd0ca9dcbb0427882fc53a3bcbef6a91 Mon Sep 17 00:00:00 2001 From: Allan Zhang Date: Tue, 28 Nov 2023 18:07:00 -0500 Subject: [PATCH 1/2] Minor doc fixes --- src/service/service.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/service/service.rs b/src/service/service.rs index 95024bee44..fe662b98c2 100644 --- a/src/service/service.rs +++ b/src/service/service.rs @@ -28,13 +28,14 @@ pub trait Service { type Future: Future>; /// Process the request and return the response asynchronously. - /// call takes a &self instead of a mut &self because: + /// `call` takes `&self` instead of `mut &self` because: /// - It prepares the way for async fn, - /// since then the future only borrows &self, and thus a Service can concurrently handle + /// since then the future only borrows `&self`, and thus a Service can concurrently handle /// multiple outstanding requests at once. /// - It's clearer that Services can likely be cloned - /// - To share state across clones you generally need Arc> - /// that means you're not really using the &mut self and could do with a &self - /// To see the discussion on this see: + /// - To share state across clones, you generally need `Arc>` + /// That means you're not really using the `&mut self` and could do with a `&self`. + /// The discussion on this is here: fn call(&self, req: Request) -> Self::Future; } + From 8eca221a2cba68093086887474cf63ef09f3a15a Mon Sep 17 00:00:00 2001 From: Allan Zhang Date: Thu, 30 Nov 2023 11:23:32 -0500 Subject: [PATCH 2/2] rustfmt --- src/service/service.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/service/service.rs b/src/service/service.rs index fe662b98c2..c6db129bf4 100644 --- a/src/service/service.rs +++ b/src/service/service.rs @@ -38,4 +38,3 @@ pub trait Service { /// The discussion on this is here: fn call(&self, req: Request) -> Self::Future; } -