Closed macpie closed 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...
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
It seems like this version of Rust does not like to have
struct
andimpl
in different files.