Closed adriandelgado closed 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.
My bad, I didn't re run the tests after rebasing...
I added the missing &mut
and removed some backticks. It now passes cargo doc
and cargo test
.
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.
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:
rust_xlsxwriter
and other crate elements()
after names of functions and methods"".to_string()
andString::from("")
toString::new()
From::from
instead ofas
conversions whenever possible#[must_use]
to relevant functionsIterator::cloned
toIterator::copied
whenever possiblesort_unstable
instead ofsort
when working with primitivesfor _ in _.iter()
tofor _ in &_
(same withiter_mut
)