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

ckb-network-fuzz: make cargo clippy happy #4767

Merged

Conversation

eval-exec
Copy link
Collaborator

What is changed and how it works?

make cargo clippy for ckb-network-fuzz happy

What's Changed:

Related changes

  • Fix clippy warning in ckb-network-fuzz

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • None

Release note

None: Exclude this PR from the release note.

@eval-exec eval-exec requested a review from a team as a code owner January 3, 2025 08:41
@eval-exec eval-exec requested review from zhangsoledad and removed request for a team January 3, 2025 08:41
@eval-exec
Copy link
Collaborator Author

eval-exec commented Jan 3, 2025

There are two Clippy warnings that need to be resolved.

ckb/network/fuzz on  exec/fix-network-fuzz-clippy is 📦 v0.121.0-pre via 🦀 v1.85.0-nightly via ❄️  impure (nix-shell)
❯ cargo clippy
    Checking ckb-network-fuzz v0.121.0-pre (/home/exec/Projects/github.com/nervosnetwork/ckb/network/fuzz)
error[E0277]: the trait bound `ipnetwork::IpNetwork: std::convert::From<ipnetwork::Ipv6Network>` is not satisfied
  --> fuzz_targets/fuzz_peer_store.rs:39:50
   |
39 |             data.get::<ipnetwork::Ipv6Network>().into()
   |                                                  ^^^^ the trait `std::convert::From<ipnetwork::Ipv6Network>` is not implemented for `ipnetwork::IpNetwork`
   |
   = help: the following other types implement trait `std::convert::From<T>`:
             `ipnetwork::IpNetwork` implements `std::convert::From<ipnetwork::ipv4::Ipv4Network>`
             `ipnetwork::IpNetwork` implements `std::convert::From<ipnetwork::ipv6::Ipv6Network>`
             `ipnetwork::IpNetwork` implements `std::convert::From<std::net::IpAddr>`
   = note: required for `ipnetwork::Ipv6Network` to implement `std::convert::Into<ipnetwork::IpNetwork>`

error[E0277]: the trait bound `ipnetwork::IpNetwork: std::convert::From<ipnetwork::Ipv4Network>` is not satisfied
  --> fuzz_targets/fuzz_peer_store.rs:37:50
   |
37 |             data.get::<ipnetwork::Ipv4Network>().into()
   |                                                  ^^^^ the trait `std::convert::From<ipnetwork::Ipv4Network>` is not implemented for `ipnetwork::IpNetwork`
   |
   = help: the following other types implement trait `std::convert::From<T>`:
             `ipnetwork::IpNetwork` implements `std::convert::From<ipnetwork::ipv4::Ipv4Network>`
             `ipnetwork::IpNetwork` implements `std::convert::From<ipnetwork::ipv6::Ipv6Network>`
             `ipnetwork::IpNetwork` implements `std::convert::From<std::net::IpAddr>`
   = note: required for `ipnetwork::Ipv4Network` to implement `std::convert::Into<ipnetwork::IpNetwork>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `ckb-network-fuzz` (bin "fuzz_peer_store") due to 2 previous errors

Update: Resolved by setting the ipnetwork version in ckb-network-fuzz to match that of ckb-network.

@eval-exec eval-exec force-pushed the exec/fix-network-fuzz-clippy branch from 21ef485 to e7ba639 Compare January 3, 2025 09:00
@eval-exec eval-exec force-pushed the exec/fix-network-fuzz-clippy branch from e7ba639 to 129f0b3 Compare January 3, 2025 09:01
@eval-exec
Copy link
Collaborator Author

@zhangsoledad @joii2020 I think this PR is ready to merge.

@eval-exec eval-exec added the t:chore Type: Chore routines. label Jan 3, 2025
@zhangsoledad zhangsoledad added this pull request to the merge queue Jan 6, 2025
Merged via the queue into nervosnetwork:develop with commit 1de1447 Jan 6, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:chore Type: Chore routines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants