Skip to content

Commit 60365c6

Browse files
committed
format
1 parent 2ce8cb3 commit 60365c6

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/agent-client-protocol-trace-viewer/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ pub struct TraceHandle {
3636
impl TraceHandle {
3737
/// Push a new event to the trace.
3838
pub fn push(&self, event: serde_json::Value) {
39-
self.events.lock().expect("events mutex poisoned").push(event);
39+
self.events
40+
.lock()
41+
.expect("events mutex poisoned")
42+
.push(event);
4043
}
4144

4245
/// Get the current number of events.
@@ -48,7 +51,10 @@ impl TraceHandle {
4851
/// Check if empty.
4952
#[must_use]
5053
pub fn is_empty(&self) -> bool {
51-
self.events.lock().expect("events mutex poisoned").is_empty()
54+
self.events
55+
.lock()
56+
.expect("events mutex poisoned")
57+
.is_empty()
5258
}
5359
}
5460

src/agent-client-protocol/examples/simple_agent.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ async fn main() -> Result<()> {
2020
.on_receive_dispatch(
2121
async move |message: Dispatch, cx: ConnectionTo<Client>| {
2222
// Respond to any other message with an error
23-
message.respond_with_error(agent_client_protocol::util::internal_error("unhandled message"), cx)
23+
message.respond_with_error(
24+
agent_client_protocol::util::internal_error("unhandled message"),
25+
cx,
26+
)
2427
},
2528
agent_client_protocol::on_receive_dispatch!(),
2629
)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ async fn test_incomplete_line() {
220220
let result = connection.connect_to(transport).await;
221221

222222
// Server should terminate cleanly (not hang) when EOF is hit mid-message
223-
assert!(result.is_ok(), "expected clean shutdown on EOF, got: {result:?}");
223+
assert!(
224+
result.is_ok(),
225+
"expected clean shutdown on EOF, got: {result:?}"
226+
);
224227
}
225228

226229
// ============================================================================

0 commit comments

Comments
 (0)