Fix tonic conversion clippy warnings#122
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".
| impl TryFrom<Error> for Status { | ||
| type Error = Infallible; | ||
| type Error = StatusConversionError; | ||
|
|
||
| fn try_from(error: Error) -> Result<Self, Self::Error> { | ||
| Ok(status_from_error(&error)) | ||
| Ok(Status::from(error)) |
There was a problem hiding this comment.
[P1] Avoid breaking TryFrom error type in patch release
The new TryFrom<Error> for Status now exposes type Error = StatusConversionError instead of the previous Infallible. Even though the conversion still never fails, changing this associated type is a breaking public API change: existing callers that return Result<Status, Infallible> or use ? on Status::try_from(err) will stop compiling when they upgrade from 0.20.4 to 0.20.5. Clippy’s infallible-conversion lint can be satisfied by adding impl From<Error> for Status while leaving the TryFrom error type as Infallible, which preserves backward compatibility.
Useful? React with 👍 / 👎.
Summary
From<Error>conversion while keepingTryFromavailable via a documentedStatusConversionErrorAppResultalias test to satisfy clippyTesting
https://chatgpt.com/codex/tasks/task_e_68d37fa0a7f4832b83abf875fd599810