Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR feature gates serde functionality, fixing
clippy
and build errors.While linting the project I ran into these errors reported by
clippy --no-default-features
.Interestingly, the errors are not reported if
clippy
is run with the--workspace
option, which is what is used in GH ActionsLints
workflow.I have confirmed the errors are correct trying to build
rgb-lib
depending onrgb-runtime
with theserde
feature disabled. This way I get the exact same errorsclippy
reports without--workspace
. I have also checked that it compiles and runs all tests fine when including this PR.I think the issue with specifying
--workspace
is that dependency resolution is different. Specifically,rgb-wallet
's dependency onrgb-runtime
with all enabled features, includingserde
, might be masking the errors by inadvertently enabling theserde
feature onrgb-runtime
even if--no-default-features
is used.I am quite confident this might be the case as
clippy
correctly reports the errors if eithercli
is removed from the workspacemembers
or theserde
feature is removed fromrgb-wallet
's dependency onrgb-runtime
.I guess the usage of the
--workspace
option might also be the reason why some GH Actions jobs, like Build > no-default, pass instead of failing (cargo check --no-default-features
fails without--workspace
onmaster
and passes with this PR).I think cargo commands need to be run without
--workspace
, possibly separately for each package, in order to avoid hiding errors.