LukasKalbertodt / lina

Strongly typed linear algebra library with a focus on 3D applications like games (i.e. low-dimensional vectors and matrices)
https://docs.rs/lina
Apache License 2.0
11 stars 0 forks source link

apply clippy lints #2

Closed hellow554 closed 2 years ago

hellow554 commented 2 years ago

I used: cargo clippy -- -W clippy::pedantic -W clippy::nursery -A clippy::missing_panics_doc -A clippy::missing_errors_doc -A clippy::must_use_candidate -A clippy::doc_markdown

Maybe you can use cargo clippy --- -W clippy::must_use_vandidate and fix them by annotating #[must_use] to the functions clippy suggests

LukasKalbertodt commented 2 years ago

Thanks, pretty good changes overall! I actually rarely use clippy but yeah I'm happy with those changes. Except one change, which I reverted in a new commit.

Regarding #[must_use]: I'm undecided. There is also no "official" guideline on that and the standard library is also still undecided. All functions linted by clippy are constructor functions that take no arguments. I personally don't feel like people would expect those to change global state, so I don't think the annotations are worth it. But I will think about this further and might add them in the future.

LukasKalbertodt commented 2 years ago

Out of interest: are you using this library somewhere?

hellow554 commented 2 years ago

Out of interest: are you using this library somewhere?

Unfortunately I don't have a usecase for this atm, but I'm watching your profile and this popped up ;)

Maybe in the upcoming AOC, because I'm building a Vec2 from scratch all the time 🤷

LukasKalbertodt commented 2 years ago

:D

No worries. This library is still missing lots of features anyway. And there are good alternatives.