refactor: streamline status code conversion#8
Conversation
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
| fn respond_to(self, _req: &HttpRequest) -> HttpResponse { | ||
| let status = self.status_code(); | ||
| let status = ActixStatus::from_u16(status.as_u16()) | ||
| .unwrap_or(ActixStatus::INTERNAL_SERVER_ERROR); | ||
|
|
||
| let mut builder = HttpResponse::build(status); |
There was a problem hiding this comment.
[P1] Restore Actix status code conversion
The refactor now passes self.status_code() directly into HttpResponse::build, but status_code() produces a http v1::StatusCode while Actix 4 still re‑exports http v0.2::StatusCode. Previously the code converted through ActixStatus::from_u16(...) to bridge the two versions. With that conversion removed, enabling the actix feature causes this module to fail to compile because the types are different. Re‑introducing the conversion or aligning the http dependency is required for builds with the Actix feature enabled.
Useful? React with 👍 / 👎.
Summary
status_code()directly in Axum integrationstatus_code()to ActixHttpResponse::buildTesting
cargo +nightly fmt --cargo clippy -- -D warningscargo build --all-targetscargo test --allcargo doc --no-depshttps://chatgpt.com/codex/tasks/task_e_68c26f2fc388832b8181672a59dd33f1