From 841c611233aaf26fa57295dbbccef8ed0f735fed Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Wed, 24 Feb 2021 01:39:02 +0000 Subject: [PATCH] doc nits --- actix-server/Cargo.toml | 1 - actix-server/src/waker_queue.rs | 14 +++++++------- actix-service/src/lib.rs | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/actix-server/Cargo.toml b/actix-server/Cargo.toml index 9d13e456..4d153406 100755 --- a/actix-server/Cargo.toml +++ b/actix-server/Cargo.toml @@ -12,7 +12,6 @@ repository = "https://github.com/actix/actix-net.git" documentation = "https://docs.rs/actix-server" categories = ["network-programming", "asynchronous"] license = "MIT OR Apache-2.0" -exclude = [".gitignore", ".cargo/config"] edition = "2018" [lib] diff --git a/actix-server/src/waker_queue.rs b/actix-server/src/waker_queue.rs index f92363b5..e38a9782 100644 --- a/actix-server/src/waker_queue.rs +++ b/actix-server/src/waker_queue.rs @@ -8,7 +8,7 @@ use mio::{Registry, Token as MioToken, Waker}; use crate::worker::WorkerHandle; -/// waker token for `mio::Poll` instance +/// Waker token for `mio::Poll` instance. pub(crate) const WAKER_TOKEN: MioToken = MioToken(usize::MAX); /// `mio::Waker` with a queue for waking up the `Accept`'s `Poll` and contains the `WakerInterest` @@ -30,7 +30,7 @@ impl Deref for WakerQueue { } impl WakerQueue { - /// construct a waker queue with given `Poll`'s `Registry` and capacity. + /// Construct a waker queue with given `Poll`'s `Registry` and capacity. /// /// A fixed `WAKER_TOKEN` is used to identify the wake interest and the `Poll` needs to match /// event's token for it to properly handle `WakerInterest`. @@ -41,7 +41,7 @@ impl WakerQueue { Ok(Self(Arc::new((waker, queue)))) } - /// push a new interest to the queue and wake up the accept poll afterwards. + /// Push a new interest to the queue and wake up the accept poll afterwards. pub(crate) fn wake(&self, interest: WakerInterest) { let (waker, queue) = self.deref(); @@ -55,20 +55,20 @@ impl WakerQueue { .unwrap_or_else(|e| panic!("can not wake up Accept Poll: {}", e)); } - /// get a MutexGuard of the waker queue. + /// Get a MutexGuard of the waker queue. pub(crate) fn guard(&self) -> MutexGuard<'_, VecDeque> { self.deref().1.lock().expect("Failed to lock WakerQueue") } - /// reset the waker queue so it does not grow infinitely. + /// Reset the waker queue so it does not grow infinitely. pub(crate) fn reset(queue: &mut VecDeque) { std::mem::swap(&mut VecDeque::::with_capacity(16), queue); } } -/// types of interests we would look into when `Accept`'s `Poll` is waked up by waker. +/// Types of interests we would look into when `Accept`'s `Poll` is waked up by waker. /// -/// *. These interests should not be confused with `mio::Interest` and mostly not I/O related +/// These interests should not be confused with `mio::Interest` and mostly not I/O related pub(crate) enum WakerInterest { /// `WorkerAvailable` is an interest from `Worker` notifying `Accept` there is a worker /// available and can accept new tasks. diff --git a/actix-service/src/lib.rs b/actix-service/src/lib.rs index 7c3a271c..e591eb51 100644 --- a/actix-service/src/lib.rs +++ b/actix-service/src/lib.rs @@ -102,8 +102,8 @@ pub trait Service { /// call and the next invocation of `call` results in an error. /// /// # Notes - /// 1. `.poll_ready()` might be called on different task from actual service call. - /// 1. In case of chained services, `.poll_ready()` get called for all services at once. + /// 1. `poll_ready` might be called on a different task to `call`. + /// 1. In cases of chained services, `.poll_ready()` is called for all services at once. fn poll_ready(&self, ctx: &mut task::Context<'_>) -> Poll>; /// Process the request and return the response asynchronously.