quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Clippy fixes #1466

Closed StygianLightning closed 1 year ago

StygianLightning commented 1 year ago

I checked the examples and found a typo in one of the examples and an allowed lint as a workaround to a bug that's since been fixed. The other commits fix some clippy lints that show up on nightly.

StygianLightning commented 1 year ago

No worries! There's one thing I'm not sure about, and that's the use of these allow annotations:

#[allow(clippy::unnecessary_cast)] // self.hdr.msg_controllen defined as size_t

I thought size_t was platform specific, but I looked it up earlier, and it's defined unconditionally as a type alias for usize, so maybe it would make sense to remove these annotations and the cast.

Ralith commented 1 year ago

Try it and see what CI thinks?

StygianLightning commented 1 year ago

Huh, Mac doesn't like that for some reason. Gonna fix it tonight.

StygianLightning commented 1 year ago

I fixed the three instances that failed on macOS and reduced the scope of the two #[allow] annotations from my original commit.