175 Commits

Author SHA1 Message Date
Kivanc
c51d25ad30
Merge branch 'rust-lang:main' into main 2026-06-28 08:28:57 +03:00
hippietrail
ab91098fda fix: bring solution in line with exercise 2026-06-22 18:23:25 +08:00
Kivanc
f3bb6f496b
Merge branch 'main' into main 2026-06-12 16:46:52 +03: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
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
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
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
Remo Senekowitsch
fd237df59a
Merge pull request #2317 from EugenDueck/patch-1
try_from_into.rs: Improve slice implementation
2026-05-11 09:28:06 +02:00
Remo Senekowitsch
124708acd9
Use slice instead of array in iterator1
This avoids confusion between `.into_iter()` and `.iter()`. On a slice,
both methods do the same (correct) thing. Using `.into_iter()` will
result in a clippy warning about the slice not being consumed.
2026-05-03 14:56:32 +02:00
Remo Senekowitsch
346753b673
Make starting fireworks more fun :) 2026-04-13 18:58:53 +02:00
Remo Senekowitsch
7c1d8ebf49
Make users type method syntax themselves in structs3
closes #2286
2026-04-05 22:23:47 +02:00
Jatin Sanghvi
1ebb4d25a6 Update solution files to match exercise files 2025-12-19 19:32:24 +05:30
Kivanc
9c78849952 Rust fmt applied 2025-12-12 15:45:09 +03:00
Kivanc
2b79927300 Clippy suggestions implemented 2025-12-12 15:41:31 +03:00
Kivanc
4d461e0381 Error handling methods improved 2025-12-12 14:38:51 +03:00
kivancgnlp
55c6d574f6 Error handling ways updated 2025-12-12 08:42:50 +03:00
kivancgnlp
aef794d020 Cleanup routines added for the created files during runs 2025-12-11 18:43:52 +03:00
Kivanc
c7fd0e4a87 Rustfmt 2025-12-11 14:11:25 +03:00
Kivanc
ce156a349c Checker fixes 2025-12-11 14:07:37 +03:00
Kivanc
cbdc96e6cb Checker fixes 2025-12-11 14:04:16 +03:00
Kivanc
3e52e56a2a Checker fixes 2025-12-11 14:02:26 +03:00
Kivanc
b210fdf9ee Checker fix 2025-12-11 13:56:27 +03:00
Kivanc
2b5356aab5 Checker fixes 2025-12-11 13:54:17 +03:00
kivancgnlp
61824af087 File samples replaced by programatically generated files 2025-12-11 11:20:50 +03:00
kivancgnlp
3314022480 Test properties updated 2025-12-11 10:51:44 +03:00
kivancgnlp
e916628d84 File IO Exercises added and tested 2025-12-11 09:13:20 +03:00
Eugen
0bed579a4b
try_from_into.rs: Improve slice implementation
Using pattern matching, we can reduce four bound checks to just one.
2025-11-29 19:24:55 +09:00
Lev Krikken
c6c6d27232 Remove redundant error conversion functions, use enum constructors instead 2025-11-25 05:41:16 +01:00
mo8it
b5d440fdc3 Fix clippy3 2025-11-20 12:49:27 +01:00
Remo Senekowitsch
d8f4b06c91
Remove use of map in early vecs2 exercise
Students do not have the necessary knowledge at this point to understand
what's happening with the iterator combinators. This topic is covered
well by the dedicated exercises about iterators later.

closes #2102
2025-09-24 21:19:40 +02:00
mo8it
b6b94e3e96 Sync solution 2025-08-21 23:46:37 +02:00
mo8it
9a3586878d Sync solution 2025-05-13 16:24:42 +02:00
mo8it
48bab77609 Apply Clippy lints 2025-05-12 20:31:13 +02:00
Clément Bœsch
d2abc359cc Remove TODO from 2 solutions 2025-03-17 18:36:13 +01:00
mo8it
374c3874af Apply 2024 edition formatting to solutions 2025-02-21 13:08:34 +01:00
mo8it
65dc019fa6 Fix new Clippy error in solution 2025-02-18 20:15:50 +01:00
mo8it
bde6f7470c Co-ordinates -> Coordinates 2024-12-28 16:46:24 +01:00
Antoine Dupuis
fc0cd8f0f8 Switch comment style to // 2024-11-14 09:14:40 +01:00
Antoine Dupuis
d5cae8ff59 Add alternative solution using From trait 2024-11-13 23:51:09 +01:00
mo8it
38016cb2d6 clippy3: Make the intent more clear 2024-11-13 16:06:41 +01:00
Vincent Ging Ho Yim
6bec6f92c4 threads1: Fix typos in description 2024-10-22 16:53:23 +11:00
mo8it
0e090ae112 Add required type annotation 2024-10-17 14:49:07 +02:00
mo8it
f146553dea hashmap3: Use or_default 2024-10-17 14:49:07 +02:00
mo8it
f516da4138 Avoid single char variables 2024-10-09 15:27:36 +02:00
Samuel Tardieu
2653c3c4d4 Do not use .as_bytes().len() on strings 2024-09-22 10:49:55 +02:00
Remo Senekowitsch
b540c6df25 Make if2 less confusing
Some people would get stuck on this exercise, trying to understand the meaning
behind foo, fuzz, baz etc. Making the theme of the code make a little more sense
to humans should hopefully prevent people from getting confused by abstract and
non-sensical tests.
2024-09-14 10:03:52 +02:00