A simple command-line to-do list application written in Rust, built as a learning project.
- Add, complete, and remove tasks
- View the full list with completion status
- Load tasks from a file at startup (optional, user-chosen filename)
- Automatically save changes to a file so tasks persist between runs
- Input validation: invalid menu choices or indices don't crash the program
Tasks are stored as plain text, one per line, in the format:
[x] Buy milk
[ ] Call dentist
[x] marks a completed task, [ ] marks a pending one.
Clone the repository and run it with Cargo:
git clone https://github.com/sil-28/ToDo_List.git
cd ToDo_List
cargo runOn startup, you'll be asked whether you want to load an existing file. Answer Y and provide a filename (without extension) to load a previously saved list, or N to start with an empty list saved to tasks.txt by default.
1. Add task
2. Complete task
3. Remove task
4. Show list
5. Exit
This project was built while learning Rust from scratch, focusing on:
- Ownership and borrowing (
&,&mut) - Structs and enums
- Pattern matching (
match) OptionandResultfor error handling- Reading from and writing to files (
std::fs,std::io)
- Load the filename via command-line arguments instead of an interactive prompt
- Switch file storage to JSON using
serde - Add due dates or priority levels to tasks