From 8974a69c31ec456d02957c300b4914f7af5dc763 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Wed, 2 Oct 2024 17:31:33 -0400 Subject: [PATCH 1/2] fix rename --- crates/stages/api/src/stage.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/stages/api/src/stage.rs b/crates/stages/api/src/stage.rs index 1e201aee6635..80a68a7599ac 100644 --- a/crates/stages/api/src/stage.rs +++ b/crates/stages/api/src/stage.rs @@ -199,7 +199,7 @@ pub trait Stage: Send + Sync { /// Returns `Poll::Ready(Ok(()))` when the stage is ready to execute the given range. /// /// This method is heavily inspired by [tower](https://crates.io/crates/tower)'s `Service` trait. - /// Any asynchronous tasks or communication should be handled in `poll_ready`, e.g. moving + /// Any asynchronous tasks or communication should be handled in `poll_execute_ready`, e.g. moving /// downloaded items from downloaders to an internal buffer in the stage. /// /// If the stage has any pending external state, then `Poll::Pending` is returned. @@ -208,18 +208,18 @@ pub trait Stage: Send + Sync { /// depending on the specific error. In that case, an unwind must be issued instead. /// /// Once `Poll::Ready(Ok(()))` is returned, the stage may be executed once using `execute`. - /// Until the stage has been executed, repeated calls to `poll_ready` must return either + /// Until the stage has been executed, repeated calls to `poll_execute_ready` must return either /// `Poll::Ready(Ok(()))` or `Poll::Ready(Err(_))`. /// - /// Note that `poll_ready` may reserve shared resources that are consumed in a subsequent call + /// Note that `poll_execute_ready` may reserve shared resources that are consumed in a subsequent call /// of `execute`, e.g. internal buffers. It is crucial for implementations to not assume that /// `execute` will always be invoked and to ensure that those resources are appropriately /// released if the stage is dropped before `execute` is called. /// /// For the same reason, it is also important that any shared resources do not exhibit - /// unbounded growth on repeated calls to `poll_ready`. + /// unbounded growth on repeated calls to `poll_execute_ready`. /// - /// Unwinds may happen without consulting `poll_ready` first. + /// Unwinds may happen without consulting `poll_execute_ready` first. fn poll_execute_ready( &mut self, _cx: &mut Context<'_>, From c7aebff0b6bc19cd0b73e295497d3c5150d40ed8 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Wed, 2 Oct 2024 17:56:01 -0400 Subject: [PATCH 2/2] rustfmt --- crates/stages/api/src/stage.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/stages/api/src/stage.rs b/crates/stages/api/src/stage.rs index 80a68a7599ac..368269782a29 100644 --- a/crates/stages/api/src/stage.rs +++ b/crates/stages/api/src/stage.rs @@ -199,8 +199,8 @@ pub trait Stage: Send + Sync { /// Returns `Poll::Ready(Ok(()))` when the stage is ready to execute the given range. /// /// This method is heavily inspired by [tower](https://crates.io/crates/tower)'s `Service` trait. - /// Any asynchronous tasks or communication should be handled in `poll_execute_ready`, e.g. moving - /// downloaded items from downloaders to an internal buffer in the stage. + /// Any asynchronous tasks or communication should be handled in `poll_execute_ready`, e.g. + /// moving downloaded items from downloaders to an internal buffer in the stage. /// /// If the stage has any pending external state, then `Poll::Pending` is returned. /// @@ -211,10 +211,10 @@ pub trait Stage: Send + Sync { /// Until the stage has been executed, repeated calls to `poll_execute_ready` must return either /// `Poll::Ready(Ok(()))` or `Poll::Ready(Err(_))`. /// - /// Note that `poll_execute_ready` may reserve shared resources that are consumed in a subsequent call - /// of `execute`, e.g. internal buffers. It is crucial for implementations to not assume that - /// `execute` will always be invoked and to ensure that those resources are appropriately - /// released if the stage is dropped before `execute` is called. + /// Note that `poll_execute_ready` may reserve shared resources that are consumed in a + /// subsequent call of `execute`, e.g. internal buffers. It is crucial for implementations + /// to not assume that `execute` will always be invoked and to ensure that those resources + /// are appropriately released if the stage is dropped before `execute` is called. /// /// For the same reason, it is also important that any shared resources do not exhibit /// unbounded growth on repeated calls to `poll_execute_ready`.