-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: various, mostly from cargo clippy -- --warn clippy::pedantic
#77
fix: various, mostly from cargo clippy -- --warn clippy::pedantic
#77
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fixes, we are having an overflow when eating a another piece thought we need to fix that
I'm sorry, didn't quite understand that. |
To reproduce the bug I found while running on your branch run a classic game, move a white pawn twice, same for black, then eat the black pawn with the white one and the game should quit with a rust panick |
Actually it's interesting, because as far as I'm concerned, no code logic was changed before, so it shouldn't have happened, but luckily enough it seems to be fixed now, by commit a0a829b. |
This is very weird yes, I'm gonna check in detail this commit tonight thank you for fixing it ! |
Perfect thanks again for yet another contribution @JeromeSchmied |
Code improvement
Description
Various code improvements, to make the code more readable, efficient and more
Rust
yutils.rs
wereself impl
s -> removed themmut
was needed, instead offor ...
....iter().collect()
was enoughcargo clippy -- --warn clippy::pedantic
fixes, eg.Coord
as value instead of reference, as it's more efficient;
to line-end if not returningformat!("{}", x)
can beformat!("{x}")
match
branchesString::new()
instead of"".to_string()
fn
-s take&str
instead ofString
Checklist: