Fix issues from `cargo clippy` and add check in the verification
I see that cargo clippy returns quite a lot of warnings (8 at the moment) while there is benefit in maintaining the report clean.
I think we should:
- Fix all warnings. I can do it as they are quite simple.
- Add a pipeline check as verification when a pull request is proposed for merging. For that it would take more time for me as I don't know how to do it.
I fixed a bunch here: https://github.com/isosphere/yew-bootstrap/commit/94eb9e31bbd609b92c3509dd0263ff3f61322844
I agree re: CI; I'm not super familiar with github actions but it should be simple enough for us to shove a "cargo clippy" command in there somewhere.
Ok I will rebase and verify.
I asked Claude AI this question:
On Yew Bootstrap Rust library, how can I add an action to run cargo clippy when someone proposes a pull request?
And it answered (Not verified):
name: Clippy Check
on:
pull_request:
branches: [ main ]
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Run Clippy
run: cargo clippy -- -D warnings
Actually it would make sense to add cargo test as well in the main package. Even if no tests exist at the moment (Although I am going to add some), there are at least all the tests on the examples for the documentation.
Note that as I am adding an independent feature, it should launch:
cargo clippy --all-featurescargo test --all-features