Skip to content

Commit 6363f59

Browse files
committed
Fix doctests
1 parent 36f65ff commit 6363f59

3 files changed

Lines changed: 4 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
run: cargo build --all-targets --all-features
4747

4848
- name: Run tests
49-
run: cargo test --all-features
49+
run: cargo test --all-features --workspace

src/sacp/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@
2323
//! // Create one or more request handlers -- these are attempted in order.
2424
//! // You can do anything you want in here, but you should eventually
2525
//! // respond to the request with `request_cx.respond(...)`:
26-
//! request_cx.respond(InitializeResponse {
27-
//! protocol_version: initialize.protocol_version,
28-
//! agent_capabilities: AgentCapabilities::default(),
29-
//! auth_methods: Default::default(),
30-
//! agent_info: Default::default(),
31-
//! meta: Default::default(),
32-
//! })
26+
//! request_cx.respond(InitializeResponse::new(initialize.protocol_version))
3327
//! })
3428
//! .on_receive_message(async move |message: MessageAndCx<UntypedMessage, UntypedMessage>| {
3529
//! // You can also handle any kind of message:

src/sacp/src/util/typed.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,13 @@ use crate::{
3030
/// MatchMessage::new(message)
3131
/// .if_request(|req: InitializeRequest, cx: sacp::JrRequestCx<InitializeResponse>| async move {
3232
/// // Handle initialization
33-
/// let response = InitializeResponse {
34-
/// protocol_version: req.protocol_version,
35-
/// agent_capabilities: Default::default(),
36-
/// auth_methods: vec![],
37-
/// meta: None,
38-
/// agent_info: None,
39-
/// };
33+
/// let response = InitializeResponse::new(req.protocol_version);
4034
/// cx.respond(response)
4135
/// })
4236
/// .await
4337
/// .if_request(|req: PromptRequest, cx: sacp::JrRequestCx<PromptResponse>| async move {
4438
/// // Handle prompts
45-
/// let response = PromptResponse {
46-
/// stop_reason: sacp::schema::StopReason::EndTurn,
47-
/// meta: None,
48-
/// };
39+
/// let response = PromptResponse::new(sacp::schema::StopReason::EndTurn);
4940
/// cx.respond(response)
5041
/// })
5142
/// .await

0 commit comments

Comments
 (0)