-
Notifications
You must be signed in to change notification settings - Fork 272
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
Clean up examples, make it more "Rusty" #1649
Conversation
examples/connect5.rs
Outdated
@@ -651,10 +636,8 @@ fn eval(pos: &Pos, _ply: i32) -> i32 { | |||
return 2560; | |||
} | |||
} | |||
} else { | |||
if check_patterndead4(pos, atk) > 0 { |
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.
I'm not a fan of this clippy lint, I think in many cases it actually makes the code less readable.
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.
@Amanieu which clippy lint are you not a fan of? Most of these are simple stylistic changes that are pretty standard in the Rust code... to my knowledge
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.
Specifically the one that turns else { if X {} }
into else if X {}
. I often find that the additional nesting improves readability, especially if the X
condition is completely unrelated to the condition in the outer if
.
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.
Could you undo the change to else
here and above?
f233e0a
to
9c5e92b
Compare
thx, fixed |
No description provided.