8000 chore(rpc,node)!: Fix clippy issues by oblique · Pull Request #626 · eigerco/lumina · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore(rpc,node)!: Fix clippy issues #626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2025

Conversation

oblique
Copy link
Member
@oblique oblique commented May 20, 2025

No description provided.

@oblique oblique requested review from fl0rek, Copilot and zvolin May 20, 2025 09:39
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors error handling to address Clippy suggestions and adjust the gRPC error type.

  • Replaces io::Error::new calls with the io::Error::other constructor in the P2P header codec.
  • Changes the Error::TonicError variant to store a boxed Status and adds a manual From<Status> implementation.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
node/src/p2p/header_ex.rs Swapped io::Error::new(...) for io::Error::other(...).
grpc/src/error.rs Converted TonicError to Box<Status> and added From.
Comments suppressed due to low confidence (2)

grpc/src/error.rs:17

  • Boxing Status introduces a heap allocation for every gRPC error. Consider using #[from] Status directly to avoid the extra allocation unless boxing is strictly required.
TonicError(Box<Status>),

grpc/src/error.rs:72

  • [nitpick] Because the #[from] macro was removed from the variant, this manual impl is needed. It may be clearer to add a comment explaining why boxing is required or revert to the derive-based #[from] Status pattern.
impl From<Status> for Error {

@fl0rek fl0rek merged commit 605d68b into eigerco:main May 21, 2025
62 of 64 checks passed
This was referenced May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0