Skip to content

Commit 7bfa50a

Browse files
committed
refactor(acp): remove cancel request wrapper
1 parent c0c1a2f commit 7bfa50a

2 files changed

Lines changed: 1 addition & 15 deletions

File tree

src/agent-client-protocol/src/jsonrpc.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,20 +2096,6 @@ impl<Counterpart: Role> ConnectionTo<Counterpart> {
20962096
)
20972097
}
20982098

2099-
/// Send a `$/cancel_request` notification for an outgoing request.
2100-
///
2101-
/// This is a convenience wrapper around [`SentRequest::cancel`].
2102-
///
2103-
/// Cancellation is cooperative: the peer may ignore the notification, may
2104-
/// reply to the original request with [`Error::request_cancelled`], or may
2105-
/// return a normal response with partial data.
2106-
///
2107-
/// [`Error::request_cancelled`]: crate::Error::request_cancelled
2108-
#[cfg(feature = "unstable_cancel_request")]
2109-
pub fn cancel_request<T>(&self, request: &SentRequest<T>) -> Result<(), crate::Error> {
2110-
request.cancel()
2111-
}
2112-
21132099
/// Send a `$/cancel_request` notification for an arbitrary request ID to
21142100
/// the default counterpart peer.
21152101
#[cfg(feature = "unstable_cancel_request")]

src/agent-client-protocol/tests/jsonrpc_request_cancellation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ async fn request_handler_can_observe_cancellation_from_responder() {
630630
let request: SentRequest<SimpleResponse> = cx.send_request(SimpleRequest {
631631
message: "cancel me".into(),
632632
});
633-
cx.cancel_request(&request)?;
633+
request.cancel()?;
634634
Ok(request
635635
.block_task()
636636
.await

0 commit comments

Comments
 (0)