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

Chore: enable serde feature in example code #1270

Closed

Conversation

getong
Copy link
Contributor

@getong getong commented Dec 1, 2024

Checklist

  • Updated guide with pertinent info (may not always apply).
  • Squash down commits to one or two logical commits which clearly describe the work you've done.
  • Unittest is a friend:)

This change is Reviewable

@getong getong force-pushed the enable-serde-feature-in-example branch from ce24f10 to e588601 Compare December 1, 2024 14:31
@getong getong changed the title enable serde feature in example code Chore: enable serde feature in example code Dec 1, 2024
@SteveLauC
Copy link
Collaborator

Hi, I am not quite sure about why we didn't see these errors in the past, but this PR should not be considered a fix for them, we should not add a feature flag that won't be used but simply for a workaround of a clippy lint, especially in example code. If this derive does not work at all, maybe we should remove it🤔

@getong
Copy link
Contributor Author

getong commented Dec 1, 2024

Hi, I am not quite sure about why we didn't see these errors in the past, but this PR should not be considered a fix for them, we should not add a feature flag that won't be used but simply for a workaround of a clippy lint, especially in example code. If this derive does not work at all, maybe we should remove it🤔

need discussion

@drmingdrmer
Copy link
Member

The #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] is a misuse and should be removed.
I found this issue too and have had it fixed in: #1268 :

https://github.com/databendlabs/openraft/pull/1268/files#diff-8f8d2d841365befc4ced06a6646431e67d0d5a0632a7f96573ce97fb69a47ad5

@getong getong closed this Dec 2, 2024
@getong getong deleted the enable-serde-feature-in-example branch December 2, 2024 05:52
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