Fix Type Annotation after deranged
Update
#2261
Closed
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.
Description of change
Actual change intended here
The
deranged
crate, that can be included in the project, e.g. viastronghold
feature, has added implementations forusize: PartialOrd<_>
in its latest updates. This can lead to conflicts with implementations fromcore
, e.g. in code related to theclient
feature, producing build errors like these:This can be reproduced by creating a new project, that uses
iota-sdk
with featuresclient
andstronghold
enabled:cargo init build-test cd build-test cargo add iota-sdk --features=client,stronghold cargo build
This PR updates the affected calls to use fully qualified paths in the first commit.
Fixes for findings in CI
Linting rule changes
result_large_err = "allow"
due to errors related to the large error objectsclippy::empty_docs
as there were a lot of errors (~100) due to the empty doc blocks, that had been insertedclippy::needless_lifetimes
inbindings/core
due to linting errors fromderivative::Derivative
This could be done differently by wrapping the 16 cases where the error was thrown into an inner module with this rule disabled, and then
pub use
ing the structs back into the parent scope. Another possible solution would be to replace thederivative
crate, but decided to suggest disabling the rule for now and postponing the decision how to refactor this to a later point in time.The two
mut
sThe commits afterward fix findings from the CI. Tried to split the changes into separate commits for the respective steps to not get mixed up in one large commit.
Also, a bit unsure about the updates:
clippy
complained about&self
being mutable even it isn't required here, so removed themut
. Theoretically, this might allow someone modifying the related instances while the two updateasync
functions are running, which might lead to an unexpected result. So, not sure if we should remove themut
(as currently done in this PR) or just ignore the warning in these places.cargo audit
Bumped two dependencies where fix versions, where available, not sure about the remaining 5, maybe we have to add them to the ignore list for now, as refactoring the usage of them might require more work.
Python bindings checks
Not really an idea, why this fails with
ImportError: No module named iota_sdk.client.client.Client
to be honest. :/Type of change
How the change has been tested
Removed
deranged
andtime
dependencies from rootCargo.lock
and rancargo build
to force updating to the newest version. Confirmed, that sdk still builds and tests run successfully locally.Also did the same update to the
Cargo.lock
inidentity.rs
and confirmed, that got the same errors with the current state, and that I could build the project again after switchingiota-sdk
dependency to this PR's branch and applying a similar fix as done for this PR to theidentity.rs
code.Change checklist
Tick the boxes that are relevant to your changes, and delete any items that are not.