Skip to content
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

Replace err_derive dependency with manual impl of Display + Error #59

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

faern
Copy link
Member

@faern faern commented May 29, 2024

Building this library on beta or nightly yields the following warning:

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> nftnl/src/batch.rs:8:10
   |
8  | #[derive(err_derive::Error, Debug)]
   |          ^----------------
   |          |
   |          `Error` is not local
   |          move the `impl` block outside of this constant `_DERIVE_std_error_Error_FOR_NetlinkError`
9  | #[error(display = "Error while communicating with netlink")]
10 | pub struct NetlinkError(());
   |            ------------ `NetlinkError` is not local

We only have a single error in this crate, and it's an extremely simple one. Here I just replace this derive macro with a simple manual implementation! Less weird bugs and much more future proof! And fewer dependencies! 🥳 This change removes eleven dependencies from the dependency tree of this (should be) small library.

Getting rid of these warnings is a prerequisite for getting #57 into a working state.


This change is Reviewable

@faern faern requested a review from Serock3 May 29, 2024 19:27
@faern faern force-pushed the remove-err_derive-dependency branch from 457f095 to 9a163c1 Compare May 29, 2024 19:30
Copy link

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

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

🙌

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@faern faern force-pushed the remove-err_derive-dependency branch from 9a163c1 to 5ecfb5f Compare June 3, 2024 22:19
@faern faern merged commit 18fab09 into main Jun 3, 2024
1 check passed
@faern faern deleted the remove-err_derive-dependency branch June 3, 2024 22:20
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.

2 participants