Commit Graph
19 Commits
Author SHA1 Message Date
Remo SenekowitschandGitHub 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 SenekowitschandPiotr Spieker d9e0b103c4 Update hint of enums2
This was discussed in another PR, but it was merged before the code was
updated to the most recent consensus:
https://github.com/rust-lang/rustlings/pull/2353

Co-authored-by: Piotr Spieker <p.spieker@posteo.de>
2026-05-09 21:15:18 +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 4c4dd20be3 Merge main into senekor/soqukxyvzplr 2026-04-25 14:08:53 +02:00
Remo Senekowitsch e0334f79fe Avoid nested function definition 2026-04-25 14:08:53 +02:00
Remo Senekowitsch b86a532e28 Document enter keybind in list footer 2026-04-25 13:58:31 +02:00
Remo Senekowitsch c658a997f3 Turn unnecessary closure into regular function 2026-04-20 13:55:08 +02:00
Remo Senekowitsch 870776d03b Allow selecting next exercise with enter key 2026-04-19 00:38:18 +02:00
Remo Senekowitsch 03c5baf35c Emphasize hotkeys in footer with color 2026-04-18 05:57:14 +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
Remo Senekowitsch 17ff88902b Avoid initializing nested Git repository
Previously a Git repository was initialized if a Cargo workspace was
detected. However, it's also possible for users to initialize rustlings
in an existing Git repository that doesn't contain a Cargo workspace. In
that case, it's still undesirable to initialize a nested Git repository
for rustlings. We therefore search all ancestors of the current working
directory for `.git` or `.jj` directories to determine if rustlings is
being initialized in an existing Git repository.
2026-02-26 17:57:47 +01:00
Remo Senekowitsch c163bfe563 Improve error messages if tests fail 2026-02-26 17:40:35 +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
Remo Senekowitsch 95a597eb82 Fix workspace detection with windows line endings
Some cargo workspaces may contain windows line endings. Even if the
file is stored in a repo with unix line endings, users may have some
setting activated that automatically translates them to windows line
endings when working locally.
2025-09-23 15:29:26 +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
Remo Senekowitsch 8b43d79257 Fix integration tests 2024-08-08 14:08:06 +02:00
Remo Senekowitsch dc086c6bf1 Improve initialization in workspace
- Detect if we are in a cargo project more reliably.
  (e.g. if `rustlings init` is run in the `src/` directory)

- Refuse to initialize rustlings in a non-workspace cargo project.

- Automatically populate the `workspace.members` field if `rustlings init` is
  run in a workspace.

  This may be considered risky, as there is no guarantee that's what the user
  wanted to do. However, it is consistent with the behavior of `cargo new`.
  Also, newcomers to Rust are unlikely to accidentally be in a cargo workspace,
  as they won't know how to create one in the first place.

  The use case for initialization in a workspace is when a workshop organizer
  wants to use rustlings alongside other exerices and provide a single
  repository with everything in one place.
2024-08-08 13:34:27 +02:00
Remo Senekowitsch dc0ffbe16e Replace hashbrown with ahash
hashbrown is already used in the standard library, but we want the
improved performance of the different hash algorithm.
Using ahash directly conveys this intent more clearly.
2024-08-08 11:12:17 +02:00