Feature Request: File I/O Exercises in Rustlings
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading the existing Rustlings exercise structure and how its tests and embedded files are handled. Then assess whether a new 24_file_io/ category can support file_io1.rs, file_io2.rs, file_io3.rs and their input/output files. Done means the structure is agreed and the three progressive exercises have tests for the described file operations.
Written by the indexing model from the issue text.
Description
Description
Add a new category (24_file_io/) focused on file operations, a crucial skill for Rust developers currently missing from Rustlings.
Proposed Exercises
-
Basic File Reading (file_io1.rs)
- Teaches using
fs::read_to_stringand handling file not found errors - Includes input file with text content to read
- Tests verifying correct content parsing
- Teaches using
-
Buffered Reading & Writing (file_io2.rs)
- Demonstrates efficient reading with
BufReaderand writing withBufWriter - Processes a large input file line by line
- Writes transformed content to an output file
- Tests verifying correct transformation
- Demonstrates efficient reading with
-
Path Manipulation & Metadata (file_io3.rs)
- Works with
PathandPathBufto handle file paths safely - Extracts and manipulates file metadata (creation time, size, permissions)
- Tests verifying correct metadata extraction
- Works with
Implementation Structure
- Each exercise includes a Rust file and associated input/output files
- Files are embedded and available during testing
- All exercises follow Rustlings patterns with TODO comments and progressive difficulty
Questions
- Is handling extra files (inputs/outputs) compatible with current Rustlings structure?
- Any specific file I/O patterns you'd prefer to prioritize?
I'm happy to draft sample implementations if this proposal is of interest.
cc @mo8it
- Dominant language
- Rust
- Stars
- 64.6k
- Forks
- 11.3k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/rustlings
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
A-exercises C-enhancement P-low
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Proposal: German (Deutsch) translation for Community ExercisesMay be free again @mo8it claimed this 62 days ago, and no pull request is open. Open
rust-lang/rustlings#2445 · 4 comments · 2 reactions · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in rust-lang/rustlings
Similar issues
-
Panic on live viewport resize when unstyled elements exist in display: none subtreePossibly taken @GoCoder7 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DioxusLabs/blitz#1488 ·
Maintainers usually reply within 1 day
-
🏷️ good first issue enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
S-Needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
vectordotdev/vrl#2042 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day