jmcnamara / rust_xlsxwriter

A Rust library for creating Excel XLSX files.
https://crates.io/crates/rust_xlsxwriter
Apache License 2.0
316 stars 25 forks source link

Fix several `clippy::pedantic` lints #22

Closed adriandelgado closed 1 year ago

adriandelgado commented 1 year ago

I ran cargo clippy --fix -- -W clippy::pedantic and manually inspected the changes. These are the fixes. There are a lot of fixes left, but this is the first batch. Also, while reading the code I found some bug fixes for future PR. (and performance improvements too). Sometimes, each programmer has their own code style so feel free to revert any changes this PR made.

This is a summary of the changes:

adriandelgado commented 1 year ago

As said in the related issue feel free to ask to revert any of the changes suggested. And this was just the first step to get familiarized with the code, I plan to submit less trivial PRs in the near future.

All of the changes proposed here are reasonable (in my opinion), I can give a justification for any of them. I can also split this PR into several parts if you want to.

adriandelgado commented 1 year ago

My bad, I didn't re run the tests after rebasing...

adriandelgado commented 1 year ago

I added the missing &mut and removed some backticks. It now passes cargo doc and cargo test.

adriandelgado commented 1 year ago

I ran cargo clippy --all-targets in addition to cargo doc and cargo test. It will pass everything now. I think.

It seems like some of the iterator fixes made clippy find other warnings.