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

Feedback #2

Merged
merged 1 commit into from May 21, 2022
Merged

Feedback #2

merged 1 commit into from May 21, 2022

Conversation

douweschulte
Copy link
Contributor

I saw your question for feedback so here is some.

First of all clippy is your friend:

warning: this `.fold` can be written more succinctly using another method
  --> src\ai.rs:31:10
   |
31 |         .fold(0, |a, b| a + b); //.expect("If no distance was here, we couldn't have won or lost.");
   |          ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
   |
   = note: `#[warn(clippy::unnecessary_fold)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold

You can find clippy here: https://github.com/rust-lang/rust-clippy. On the same note rustfmt is very nice as well.

Otherwise I have tried to leave feedback inline. If you have any more questions feel free to reach out. And a very very nice first project for a new Rust user, a lot of moving parts and a lot of logic that is tricky to get right. So very good job!

@arnemileswinter
Copy link
Owner

I really appreciate it! Thanks for the tip with clippy.

The comments are super helpful, I'm grateful for the work you put into this.

Also cool trick when placing the initial pieces, never thought of that, it's really neat :)

I feel it's much more idiomatic now, and I learnt a lot of new functions from this, thanks!

@arnemileswinter arnemileswinter merged commit 5de0a74 into arnemileswinter:main May 21, 2022
@douweschulte
Copy link
Contributor Author

You are welcome!

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.

None yet

2 participants