boinkor-net / governor

A rate-limiting library for Rust (f.k.a. ratelimit_meter)
https://github.com/boinkor-net/governor
MIT License
550 stars 43 forks source link

All clippy warnings that currently block compliation #235

Open koshell opened 2 months ago

koshell commented 2 months ago

Versions: rustc 1.79.0 clippy 0.1.79

Warnings: clippy::default_constructed_unit_structs clippy::single_char_pattern clippy::len_zero clippy::clone_on_copy clippy::duplicated_attributes

After going back through to check for these I realised all of them, except clippy::duplicated_attributes, occur in tests and therefore can likely be ignored.

Changing

#![deny(warnings)]

to

#![cfg_attr(not(test), deny(warnings))]

would allow the crate to compile (assuming clippy::duplicated_attributes is resolved).

However I would recommend reading over this and considering if you even want to keep deny(warnings) in general.

antifuchs commented 2 months ago

Hrm, it seems that I was building this with the wrong clippy version all along, can now repro them. I think your suggestion of turning the deny(warnings) off in tests is sound - it's not like we care much about perf or other little nits there.

duplicated_attributes is worth fixing though, of course (: