Skip to content

Commit c4fffea

Browse files
maxholmanclaude
andcommitted
style: use .into() for From conversions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 957990f commit c4fffea

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

crates/api/src/handlers.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ pub async fn stats(State(state): State<ApiState>) -> Result<Json<StatsResponse>,
266266
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
267267

268268
match resp.response {
269-
Some(management_response::Response::Stats(s)) => Ok(Json(StatsResponse::from(s))),
269+
Some(management_response::Response::Stats(s)) => {
270+
let stats: StatsResponse = s.into();
271+
Ok(Json(stats))
272+
}
270273
_ => Err(StatusCode::INTERNAL_SERVER_ERROR),
271274
}
272275
}

crates/core/src/ipc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ fn dispatch_request(request: &ManagementRequest, api: &dyn NodeApi) -> Managemen
304304
}
305305

306306
Some(management_request::Request::Stats(_)) => {
307-
management_response::Response::Stats(StatsResponse::from(api.metrics()))
307+
management_response::Response::Stats(api.metrics().into())
308308
}
309309

310310
Some(management_request::Request::Peers(_)) => {

0 commit comments

Comments
 (0)