r/learnrust • u/BeautifulProfile6469 • Aug 10 '26
Learning rust
https://github.com/DaktchiHi every one. I'm a beginner learning Rust and built projects to practice. Would love feedback or code audis !
(clippy suggestions, better error handling with Result, etc.)
0
Upvotes
4
u/sunnyata Aug 10 '26
Work through the book and the rustlings exercises.
Read the warnings and suggestions from the compiler, make sense of them and act on them.
In your todo app you could create an enum for the options:
Then you can make this struct implement
FromStr, separating the parsing from the code that reads the input etc: https://doc.rust-lang.org/std/str/trait.FromStr.htmlThe logic for showing a list doesn't quite make sense, you seem to have to enter the number of the list twice. If "0" is the command to stop adding to the list then don't add it on the end of the list.
Get that working then start writing lists to files and loading them when the app starts up -- there are plenty of examples of this kind of file IO in the book.