Tic Tac Toe CLI Game in Rust - Seeking Code Review

I've developed a Tic Tac Toe game in Rust, and it's my first Rust project coming from an OOP-oriented language (Python). It's been a fun learning experience!

Here is the repo: Tic Tac Toe Repo.

I'd greatly appreciate your feedback and code review.

A good start is to use cargo clippy. Especially as a beginner coming from other languages it will often give you good suggestions for making things more "rusty". There's quite a few suggestions it will give you on your code.

3 Likes

This is pretty dang neat, good work!

A couple of suggestions based on a quick code review:

  • When you find common code (e.g. your console input call in main.rs), it might be wise to factor that out into a separate module. Then you can achieve the same effect with a single function call - and if you need to update the error message, you're only doing it one place.
  • Along those lines, if you decouple the i/o from the logic, it makes it easier to write test cases for those functions.

There's a ton of effort and passion here, I like to see it!

1 Like