helium / oracles

Oracles for Helium subDAOs
Apache License 2.0
19 stars 21 forks source link

Fix clippy #803

Closed macpie closed 5 months ago

macpie commented 5 months ago

It seems like this version of Rust does not like to have struct and impl in different files.

macpie commented 5 months ago

I have tried and clippy is not happy:

error: associated function `new` is never used
  --> mobile_verifier/tests/common/mod.rs:26:12
   |
25 | impl MockHexBoostingClient {
   | -------------------------- associated function in this implementation
26 |     pub fn new(boosted_hexes: Vec<BoostedHexInfo>) -> Self {
   |            ^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`

But new is used...

jeffgrunewald commented 5 months ago

I would go with that approach and just slap a #[allow(dead_code)] on the new method and be done with it. I think you're right that it's just unnecessarily confused by how the test environment is compiled. The above bandage is stupid but it works and allows us to maintain the struct and new impl in one place