Skip to content
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

Merged
merged 1 commit into from
Oct 1, 2024
Merged

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Sep 28, 2024

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Sep 28, 2024

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@@ -651,10 +636,8 @@ fn eval(pos: &Pos, _ply: i32) -> i32 {
return 2560;
}
}
} else {
if check_patterndead4(pos, atk) > 0 {
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Member

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?

@nyurik nyurik force-pushed the examples branch 3 times, most recently from f233e0a to 9c5e92b Compare September 30, 2024 18:35
@nyurik
Copy link
Contributor Author

nyurik commented Sep 30, 2024

thx, fixed

@Amanieu Amanieu merged commit 6f48adc into rust-lang:master Oct 1, 2024
33 checks passed
@nyurik nyurik deleted the examples branch October 1, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants