3386 Commits

Author SHA1 Message Date
Kivanc
5aef50403a
Merge 4e9b5735ada47cc391b22a52ae12f6eb39c36fcc into 02b22b49e7349b36305dbe97cd5d6e198d2f0537 2026-08-12 06:31:44 +00:00
Remo Senekowitsch
02b22b49e7 add llm usage policy for contributions 2026-08-11 14:46:06 +03:00
Remo Senekowitsch
9ed849c7aa
Merge pull request #2433 from YangSiJun528/fix-stale-exercise-references
Fix stale exercise references
2026-08-09 15:42:21 +02:00
sijun-yang
7fc3088421 Fix conversions3 explanation 2026-08-09 22:00:42 +09:00
sijun-yang
11ce37fc93 Preserve conversions3 wording 2026-08-09 15:35:18 +09:00
sijun-yang
dcc724888f Fix stale exercise references 2026-08-08 20:10:47 +09:00
mo8it
3b7ca447f1 Update Zola 2026-08-06 23:21:38 +02:00
Remo Senekowitsch
1b4e590e29 Add readme to generated rustlings directory
This can remind users how to use rustlings, in case they come back after
a lengthy break.
2026-08-05 17:49:33 +02:00
mo8it
30edc559b2 Trigger check all when an exercise is done but not marked as such 2026-08-05 15:48:49 +02:00
mo8it
9d6388387f Remove check all input 2026-08-05 15:48:49 +02:00
mo8it
283a508ad9 Add command timeout 2026-08-05 15:48:49 +02:00
mo8it
62c90241ac New check progress visualization 2026-08-05 15:48:49 +02:00
mo8it
a93a10ac68 Allow processing for hints and messages in the info file 2026-08-01 21:21:01 +02:00
mo8it
8560bac8e6 Don't require checking that an exercise runs 2026-08-01 14:46:44 +02:00
mo8it
9065860390 Fix checking for tests on Windows 2026-08-01 12:47:31 +02:00
mo8it
bb183c3f66 Update deps 2026-08-01 12:40:50 +02:00
Mo Bitar
d510f381d6 Revert "Fix dev check rejecting exercises with CRLF line endings" 2026-08-01 12:32:13 +02:00
Remo Senekowitsch
2f99667f39
Merge pull request #2425 from SandmeyerX/main
Fix `dev check` rejecting exercises with CRLF line endings
2026-07-31 19:13:47 +02:00
Sandmeyer
219f479f71 cargo fmt 2026-07-31 20:46:54 +08:00
Sandmeyer
9a21aa3806 Fix dev check rejecting exercises with CRLF line endings 2026-07-31 20:38:42 +08:00
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
Kivanc Gunalp
e0859583b3 Fix clippy collapsible_if in file_io3 cleanup
dev-check runs clippy with -D warnings against the solutions, which
flagged the nested if let Some(dir_path) = ... { if dir_path.exists() ... }
in file_cleanup as collapsible. Combined into a single if-let with a
let-chain condition (edition = "2024", so this is available).

Verified locally: compiles under --edition 2024, clippy is silent,
and the binary still runs cleanly with file size 117 and no leftover
files.
2026-07-26 15:34:10 +00:00
Kivanc Gunalp
68f8369cb4 Harden file_io exercises: remove magic number, dedupe paths
- file_io3: replace the hardcoded expected file size (117) with
  SAMPLE_TEXT.len(), so the check is derived from the actual content
  instead of an unexplained magic number.
- file_io3: use create_dir_all instead of create_dir, and add a
  sample_file_path() helper shared by main/create_required_files/
  file_cleanup to avoid three separate ad-hoc path constructions.
- file_io1/file_io2: hoist the sample text into a SAMPLE_TEXT constant
  used by both the exercise and its solution, removing duplicated
  literals.

No behavioral change: all three solutions were rebuilt and run
locally, producing identical output (file size still 117, permissions
still non-readonly) with no leftover files.
2026-07-26 15:27:53 +00:00
Kivanc Gunalp
47bc98784b Register file_io exercises in build config
Adds file_io1-3 (and their solutions) to dev/Cargo.toml's bin list so
'cargo dev check'/'cargo dev update' pick them up, and registers them in
rustlings-macros/info.toml with hints that explain each exercise's
learning goal and point at the relevant std API.
2026-07-26 15:09:07 +00:00
Kivanc Gunalp
316311e08c Add file I/O exercises (file_io1-3)
Adds three new exercises under exercises/24_file_io/, as proposed in rust-lang/rustlings#2233:

- file_io1: read a whole file with fs::read_to_string and handle the Result.
- file_io2: read/write a file efficiently with BufReader/BufWriter.
- file_io3: build a path with PathBuf and inspect it with .metadata().

Includes matching solutions and a README describing the learning goal of
each exercise.
2026-07-26 15:09:01 +00:00
Remo Senekowitsch
734461f2fb
Merge pull request #2422 from sobhanmohammadi-dev/fix-quiz3-clippy
Fix clippy warnings in quiz3 solution
2026-07-18 11:38:00 +02:00
sobhanmohammadi-dev
ceba18b476 Fix quiz3 clippy warnings 2026-07-18 13:01:52 +03:30
Remo Senekowitsch
925321705e
Clarify hint of vecs1
A user got confused, thinking the two described methods are the *only*
ones. Calling them "basic" makes clear there are other (non-basic) ones.

discussed in:
https://github.com/rust-lang/rustlings/discussions/2419
2026-07-08 10:09:02 +02:00
Mo Bitar
5e7a5d1721
Merge pull request #2414 from hippietrail/hashmaps3-english-fixes
fix: standard English grammar/phrasing
2026-06-23 12:33:51 +02:00
mo8it
d45578d1ba Update checkout action 2026-06-23 12:31:03 +02:00
hippietrail
ab91098fda fix: bring solution in line with exercise 2026-06-22 18:23:25 +08:00
Andrew Dunbar
6e31382996
fix: standard English grammar/phrasing 2026-06-17 18:00:54 +08:00
Mo Bitar
4bab596677
Merge pull request #2405 from aeft/improve-doc
Align section references with Rust Book section names
2026-05-25 15:14:05 +02:00
Zhijie Wang
9172a5bf27 Align section references with Rust Book section names 2026-05-24 16:51:48 -07:00
Remo Senekowitsch
b18a8c3036
strings4: remove From-based conversion
To understand From-based conversion, an understanding of traits is
required, which we teach in a later chapter. The From trait specifically
is taught in one of the conversion exercises. So, we can safely remove
it here without users missing out on learning something important.

A specific source of confusion for users was a warning that the
conversion is useless, which appeared when using the `string_slice`
function for the expression with `.into()`. closes #2190
2026-05-24 06:23:34 +02:00
Remo Senekowitsch
60b369a2fd
Explain changed line in if3 solution 2026-05-17 08:49:57 +02:00
Mo Bitar
db3f332507
Merge pull request #2315 from Lev200501/enum-constructor
Update `13_error_handling/error6`: Remove redundant functions, use enum constructors instead
2026-05-17 01:52:35 +02:00
Remo Senekowitsch
ef218cd5d0
Merge pull request #2386 from senekor/senekor/lxuqllrrmroy
Use infallible conversion to teach From trait
2026-05-15 10:44:52 +02:00
Remo Senekowitsch
361a7f501e
Add inverted formula and its derivation to hint 2026-05-15 10:41:35 +02:00
Remo Senekowitsch
360344ab6c
Simplify story and increase difficulty
Conversion between Celsius and Fahrenheit should be understandable to
most. Inverting the formula is still not very hard, but a little harder
than only multiplying by 100.
2026-05-15 10:41:35 +02:00
Remo Senekowitsch
db5ad7f42f
Use infallible conversion to teach From trait 2026-05-15 09:18:40 +02:00
Remo Senekowitsch
9b50da484f
Merge pull request #2397 from rust-lang/senekor/onvlpnlyoqww
Redesign vec1 to avoid confusing array literal
2026-05-14 23:34:25 +02:00
Remo Senekowitsch
f3036315a0
Clarify order of elements
Co-authored-by: Mo Bitar <76752051+mo8it@users.noreply.github.com>
2026-05-14 23:31:11 +02:00
Remo Senekowitsch
97a723508c
Redesign vec1 to avoid confusing array literal
Learners were sometimes confused by the literal array. Their assumption
was that they are supposed to convert the array to a vector. Duplicating
the literal elements was not an intuitive solution.

This redesign avoids putting an identical array literal near the place
where learners are supposed to use the vec! macro.
2026-05-14 16:19:53 +02:00
Remo Senekowitsch
03ddf3683b
Update changelog 2026-05-14 16:14:40 +02:00
Remo Senekowitsch
06ca7b8718
Merge pull request #2393 from foxfromworld/issue-2023-rename-exercises
Apply Option A naming for smart_pointers and conversions exercises
2026-05-13 14:43:17 +02:00
Jane
ef99b5cb9e docs: update README after rebase 2026-05-13 19:57:17 +08:00
Jane
5b1edf5f4f Rename smart_pointers and conversions exercises with numeric prefix (Option A) 2026-05-13 19:36:32 +08:00
Jane
4338c58079 Rename smart_pointers and conversions exercises with numeric prefix
Update rustlings-macros/info.toml and dev/Cargo.toml accordingly
2026-05-13 19:36:32 +08:00
mo8it
e38c82ccbb Add a hint about opening the book offline 2026-05-11 12:14:28 +02:00