Kivanc Gunalp 4e9b5735ad Use more idiomatic Rust in file_io2/file_io3
- file_io2: replace the manual line_number counter with
  .lines().enumerate(), and replace
  buffered_file_writer.write(format!(...).as_bytes()) with writeln!,
  which both formats and guarantees a complete write (write_fmt loops
  internally, unlike a single Write::write call).
- file_io3: replace the manual match on file_path.parent() with
  .ok_or_else(...)? for a more idiomatic Option-to-Result conversion.

Verified locally: both solutions compile under edition 2024, clippy is
silent, and running them still produces identical output (3 lines
processed / 117-byte file, non-readonly permissions) with no leftover
files.
2026-07-26 15:48:35 +00:00
..
2024-05-25 18:19:30 +02:00
2025-05-12 20:31:13 +02:00
2024-10-09 15:27:36 +02:00
2024-06-27 02:25:11 +02:00
2024-07-22 12:02:59 +02:00
2025-11-20 12:49:27 +01:00
2026-07-18 13:01:52 +03:30
2024-08-09 12:47:32 +02:00

Official Rustlings solutions

Before you finish an exercise, its solution file will only contain an empty main function. The content of this file will be automatically replaced by the actual solution once you finish the exercise.

Note that these solutions are often only one possibility to solve an exercise.