rustlings
rustlings copied to clipboard
v6 beta feedback 🥰
After about a month of intensive work, I am happy announce the beta release of version 6 🎉
It is a full rewrite of the command line tool. Therefore, I hope to find some people willing to test it and provide some feedback here 🥰
You can try it by following the instructions in the README of the v6
branch. NOTE: You don't need to clone the Rustlings repository anymore.
Your feedback is welcome, as detailed as you want 🥰 But don't focus on the exercises. These didn't really change in v6.
Points to consider in the feedback
- The new installation method with
cargo install
- The initialization of the
rustlings/
directory - The language server support when editing the exercises (should work out of the box now)
- The watch mode (when running
rustlings
inside therustlings/
directory):- Exercise errors and warnings
- Output of tests
- Exercise output
- Hint (when entering
h
orhint
) - Progress bar
- Current exercise path
- The list mode (when entering
l
orlist
in the watch mode):- Navigation
- Skipping exercises or going back to previous ones (by pressing
c
) - Resetting exercises
- Dumping the solution file into the
solutions/
directory after the exercise is done - CLI help messages with
--help
- Wording in general
Known issues
- The solution files are empty. I will fill them in the next days :D
- The exercise
intro1
doesn't make a lot of sense anymore - Things mentioned in the comments below
Pinging @orhun because you were willing to test it 🥰
Thanks for your efforts put into this!
I stumbled on an error while installing:
error: failed to compile `rustlings v6.0.0-beta.3`, intermediate artifacts can be found at `/var/folders/bc/g5l5nq855nd_fb3y1psnc6v00000gn/T/cargo-installsN59ZL`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Caused by:
package `clap_lex v0.7.0` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.73.0
I fixed this issue by running rustup update
. Maybe it's worth mentioning the minimal required Rust version (which seems to be 1.74) in the README?
@norraell I will add a note about this to the README. Thanks :D
@norraell The README is now updated to include rustup update
as a troubleshooting step if the installation fails :D
Hello, thanks for the ping!
I got this error right off the bat:
Error: Failed to run the command `target/debug/intro1`
Caused by:
No such file or directory (os error 2)
I'm assuming this is due to my custom cargo setup (global target
directory):
[build]
target-dir = "/drv/cargo/target"
So rustlings
probably shouldn't hardcode target
and respect this config option and also CARGO_TARGET_DIR
variable :bear:
@orhun Thank you for reporting this issue 😅
Would it be fine if I create the file .cargo/config.toml
with target-dir = "target"
to override the global setting?
Otherwise, I would need to add the serde_json
dependency and parse the JSON output of cargo metadata --no-deps --format-version 1
just to read the target_directory
field. This would mean running that command and parsing its output at every startup… Because CARGO_TARGET_DIR
is not a global environment variable.
Would it be fine if I create the file .cargo/config.toml with target-dir = "target" to override the global setting?
Don't think so, I think it would be best to not mess with the user's configuration.
Otherwise, I would need to add the serde_json dependency and parse the JSON output
Or you can simply read .cargo/config.toml
and check if the target directory is being overriden. Checking the value of CARGO_TARGET_DIR
at runtime would be fine also. So the correct logic should be:
- Check if
target-dir
is configured in.cargo/config.toml
or.cargo/config
- Check if
CARGO_TARGET_DIR
environment variable is set. - Use hardcoded
target
directory as last resort
What do you think?
It is not that easy because Cargo looks for the config file in the current directory and all parent directories. You would also need to find out what $CARGO_HOME
is. Sadly, we have platforms like Windows that we need to support 😅
I guess I will just parse that JSON then :P
It is not that easy because Cargo looks for the config file in the current directory and all parent directories.
Ouf, unfortunately I'm not aware of a crate that might help with that :/
Feedback
Here is my feedback. I already know Rust, but I never looked at rustlings
before. I hope this is not too detailed. 😅 I have written down everything I found while doing the exercises. I'm getting a little bit tired; hoping my ramblings make sense.
Here are my solutions for reference.
I'm using
- Windows 10
- cmd.exe
- VS Code 1.88.1
- Rust Analyzer v0.3.1932
1) rustlings watch
doesn't work
From the rustlings
command
Got all that? Great! To get started, run `rustlings watch` in order to get the first exercise.
Make sure to have your editor open in the `rustlings` directory!
When I run rustlings watch
:
>rustlings watch
error: unrecognized subcommand 'watch'
Usage: rustlings [OPTIONS] [COMMAND]
For more information, try '--help'.
2) Encoding/Display error
Question Mark. Unicode Replacement Character?
3) Invisible input text
Missing output when unit tests are failing
If unit tests are failing (e.g. assert_eq!(2 + 2, 5)
), there is no output of the panic message. The only thing I see:
running 14 tests
test tests::test_array_correct ... ok
test tests::test_array_out_of_range_positive ... ok
test tests::test_array_sum ... ok
test tests::test_array_out_of_range_negative ... ok
test tests::test_slice_correct ... ok
test tests::test_slice_excess_length ... ok
test tests::test_slice_insufficient_length ... ok
test tests::test_slice_out_of_range_negative ... ok
test tests::test_tuple_out_of_range_positive ... ok
test tests::test_slice_out_of_range_positive ... ok
test tests::test_slice_sum ... ok
test tests::test_tuple_out_of_range_negative ... ok
test tests::test_tuple_sum ... ok
test tests::test_tuple_correct ... FAILED
failures:
failures:
tests::test_tuple_correct
test result: FAILED. 13 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Output
Ok(Color { red: 183, green: 65, blue: 14 })
Ok(Color { red: 183, green: 65, blue: 14 })
Ok(Color { red: 183, green: 65, blue: 14 })
Ok(Color { red: 183, green: 65, blue: 14 })
4) Rust-Analyzer
Not all files with compile errors are highlighted by Rust Analyzer. Workarounds:
- Save file (without changes)
- Reload VS Code
5) Quiz
exercises\quizzes\quiz3.rs
was the first quiz I got after completing 15_traits
. I neither got quiz1.rs
nor quiz2.rs
.
6) Progress bar
This is the output after I solved the exercises in order. Note: I didn't got to quiz1.rs
or quiz2.rs
.
Output
Hello and
welcome to...
_ _ _
_ __ _ _ ___| |_| (_)_ __ __ _ ___
| '__| | | / __| __| | | '_ \ / _` / __|
| | | |_| \__ \ |_| | | | | | (_| \__ \
|_| \__,_|___/\__|_|_|_| |_|\__, |___/
|___/
This exercise compiles successfully. The remaining exercises contain a compiler
or logic error. The central concept behind Rustlings is to fix these errors and
solve the exercises. Good luck!
The file of this exercise is `exercises/00_intro/intro1.rs`. Have a look!
The current exercise path is shown under the progress bar in the watch mode.
Exercise done ✓
When you are done experimenting, enter `n` or `next` to go to the next exercise 🦀
A solution file can be found at solutions/00_intro/intro1.rs
Progress: [#######################################################################################################################################################################################>-----------------------] 85/96 exercises
Current exercise: exercises/00_intro/intro1.rs
7) Excercises
-
exercises\quizzes\quiz3.rs
: I got a bit confused. Why not directly change the line tograde: "A+".to_string(),
intests::generate_alphabetic_report_card
? -
exercises\16_lifetimes\lifetimes2.rs
: My solution was to remove the scope block{}
. Not sure if this was the intended solution. -
exercises\23_conversions\as_ref_mut.rs
: Not sure what the expected solution is. Mine got a little bit complicated:// Squares a number using as_mut(). // TODO: Add the appropriate trait bound. fn num_sq<T: AsRef<U> + AsMut<U> + Clone, U: for<'a> MulAssign<&'a U>>(arg: &mut T) { let value = arg.clone(); *arg.as_mut() *= value.as_ref(); }
- Is
exercises\19_smart_pointers\rc1.rs
maybe a little bit too easy? The solution is to blindly use the same code pattern as above. -
exercises\19_smart_pointers\arc1.rs
- Threads are first introduced in
20_threads
. - This explanation is not entirely correct because
numbers
doesn't get mutated (and becauseVec<u32>
implementsSend
/Sync
):
The reason we need// Because we are using threads, our values need to be thread-safe. Therefore, // we are using Arc. We need to make a change in each of the two TODOs.
Arcs
is becausethread::spawn
requires thatF: FnOnce() -> T + Send + 'static
. This explanation is probably too confusing for beginners.
- Threads are first introduced in
-
exercises\19_smart_pointers\cow1.rs
- Didn't know you could use
Result
as a return type in tests. :) - Taking a reference to a
Cow
is a bit uncommon. The functionabs_all
can be simplified:fn abs_all<'a>(mut input: Cow<'a, [i32]>) -> Cow<'a, [i32]> { for i in 0..input.len() { let v = input[i]; if v < 0 { // Clones into a vector if not already owned. input.to_mut()[i] = -v; } } input }
- Didn't know you could use
Nit: Wording
Especially in the first exercises, add a one-liner comment:
- What needs to be done? (fix compiler errors, fix unit tests, etc.)
- Which lines of code are allowed to change?
Here are some examples:
-
exercises\02_functions\functions1.rs
: Add// don't change this line
aftercall_me();
. Make it clear to write the function (and not to remove the call). - Most files in
exercises\01_functions
andexercises\02_functions
have no instructions. Maybe add// Make me compile!
? -
exercises\06_move_semantics\move_semantics2.rs
: Maybe make it clear when it is okay to change the unit tests and when not. -
exercises\12_options\options1.rs
: Make it more clear thatunwrap
is the desired solution in the unit testraw_value
by stating that you should not modify theassert_eq!(icecreams, 5);
line. -
exercises\13_error_handling\errors1.rs
: Instead of// Don't change this line
, say// Don't change the tests below
. - In
exercises\13_error_handling\errors2.rs
: Unless I am missing something, the success case is correct.Right now, this function isn't handling the error case at all (and isn't handling the success case properly either).
Nit: Sort Order
-
exercises\19_smart_pointers
: The files are not sorted in the correct order. Renameexercises\19_smart_pointers\box1.rs
toexercises\19_smart_pointers\01_box.rs
, etc., instead? -
exercises\23_conversions
: Same as for19_smart_pointers
above, the files are not in order.
Nit: Clippy/Compiler Warnings (Even After Solving the Exercise)
There are some compiler/clippy warnings that might be overwhelming at the start.
- Clippy warning in
exercises\08_enums\enums3.rs
:warning: used `assert_eq!` with a literal bool --> exercises/08_enums/enums3.rs:77:9 | 77 | assert_eq!(state.quit, true); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison = note: `#[warn(clippy::bool_assert_comparison)]` on by default help: replace it with `assert!(..)` | 77 - assert_eq!(state.quit, true); 77 + assert!(state.quit); |
- In
exercises\12_options\options3.rs
change they; // Fix without deleting this line.
line tolet _y = y; // Fix without deleting this line.
so that the compiler warning goes away. - Clippy warning in
exercises\13_error_handling\errors6.rs
:warning: redundant guard --> exercises/13_error_handling/errors6.rs:49:18 | 49 | x if x == 0 => Err(CreationError::Zero), | ^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards = note: `#[warn(clippy::redundant_guards)]` on by default help: try | 49 - x if x == 0 => Err(CreationError::Zero), 49 + 0 => Err(CreationError::Zero), |
- Clippy warning in
exercises\14_generics\generics1.rs
:warning: calls to `push` immediately after creation --> exercises/14_generics/generics1.rs:5:5 | 5 | / let mut shopping_list: Vec<_> = Vec::new(); 6 | | shopping_list.push("milk"); | |_______________________________^ help: consider using the `vec![]` macro: `let shopping_list: Vec<_> = vec![..];` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push = note: `#[warn(clippy::vec_init_then_push)]` on by default
- In
exercises\19_smart_pointers\rc1.rs
has some warningwarning: field `0` is never read --> exercises/19_smart_pointers/rc1.rs:16:13 | 16 | Mercury(Rc<Sun>), | ------- ^^^^^^^ | | | field in this variant | = note: `#[warn(dead_code)]` on by default help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 16 | Mercury(()), | ~~
-
exercises\20_threads\threads3.rs
- Superfluous return type
()
infn send_tx(q: Queue, tx: mpsc::Sender<u32>) -> () {
- Superfluous import
use std::sync::Arc;
- Superfluous return type
Hi Jan @dotjpg3141, thank you very much for your very valuable detailed feedback. I can't express how much it means to me, thank you for your time 🤗🤗🤗
I will probably need days to fix all the issues that you mentioned and give you a detailed reply.
@orhun Respecting the target-dir
option is done by https://github.com/rust-lang/rustlings/commit/c82c3673245ca11d455b067c97fadda4a8406cb9. You can try the new beta version beta.4
:D
Now I'm getting this:
$ rustlings init
error: could not find `Cargo.toml` in `/tmp/tmp.N6HnsDD5Fw` or any parent directory
Error: Failed to read the field `target_directory` from the `cargo metadata` output
Caused by:
EOF while parsing a value at line 1 column 0
I think it requires to be run in a Cargo project directory where Cargo.toml
is present. Is that really needed for initialization?
@orhun Oh well, this one is embarrassing… I shouldn't release anything that late in the night and should definitely add more tests. Anyway, it should work in beta.5
now 😅
No worries, all seems good now. I haven't tested the exercises but the the prompt/TUI is working smoothly for me. Great job!
I can look into this more in depth in the following days probably.
@dotjpg3141
1)
rustlings watch
doesn't work
Fixed
2) Encoding/Display error
This is a problem with the used terminal (cmd.exe
?). Users are supposed to use a modern terminal like the new Windows Terminal. I added a note to the README about the recommended terminal.
3) Invisible input text
This is very weird, but I hope that it doesn't happen in a modern terminal like Windows Terminal. Could you please try it out?
Missing output when unit tests are failing
Fixed
4) Rust-Analyzer
Not all files with compile errors are highlighted by Rust Analyzer. Workarounds:
* Save file (without changes) * Reload VS Code
I am afraid that we can't do anything about this. The most important thing is that Rust-Analyzer provides autocompletion, goto definition, rename and so on. Warnings and errors are shown by Rustlings anyway.
5) Quiz
exercises\quizzes\quiz3.rs
was the first quiz I got after completing15_traits
. I neither gotquiz1.rs
norquiz2.rs
.6) Progress bar
This is the output after I solved the exercises in order. Note: I didn't got to
quiz1.rs
orquiz2.rs
.Output Hello and welcome to... _ _ _ _ __ _ _ ___| |_| (_)_ __ __ _ ___ | '__| | | / __| __| | | '_ \ / _` / __| | | | |_| \__ \ |_| | | | | | (_| \__ \ |_| \__,_|___/\__|_|_|_| |_|\__, |___/ |___/ This exercise compiles successfully. The remaining exercises contain a compiler or logic error. The central concept behind Rustlings is to fix these errors and solve the exercises. Good luck! The file of this exercise is `exercises/00_intro/intro1.rs`. Have a look! The current exercise path is shown under the progress bar in the watch mode. Exercise done ✓ When you are done experimenting, enter `n` or `next` to go to the next exercise 🦀 A solution file can be found at solutions/00_intro/intro1.rs Progress: [#######################################################################################################################################################################################>-----------------------] 85/96 exercises Current exercise: exercises/00_intro/intro1.rs
I tried to reproduce these two issues related to the order of exercises but I couldn't. What happens if you enter n
when you see the above output? What happens when you restart Rustlings and then try to enter n
?
Could you please post the content of the hidden file .rustlings-state.txt
? A screenshot of all exercises in the list would be alse very helpful. You can open the list by entering l
.
I will fix the things that you pointed out about the exercises and Clippy later. Thank you again for your very valuable feedback 🥰
Love the new direction rustlings is taking! One issue I'm having: After starting rustlings, I get an "invalid argument" for running the intro1 command and rustlings exists.
I used [email protected]
2) Encoding/Display error
This is a problem with the used terminal (exe.cmd?).
Yep. This seems to be an issue of cmd
.
3) Invisible input text
This is very weird, but I hope that it doesn't happen in a modern terminal like Windows Terminal. Could you please try it out?
That doesn't seem to make a difference.
https://github.com/rust-lang/rustlings/assets/8530833/9dc7fab9-f372-4631-ac93-e3d62b40c46f
5) Quiz / 6) Progress bar
I tried to reproduce these two issues related to the order of exercises but I couldn't. What happens if you enter n when you see the above output? What happens when you restart Rustlings and then try to enter n?
Could you please post the content of the hidden file .rustlings-state.txt? A screenshot of all exercises in the list would be alse very helpful. You can open the list by entering l.
This is the content of `.rustlings-state.txt`.
DON'T EDIT THIS FILE!
intro1
intro2
variables1
variables2
variables3
variables4
variables5
variables6
functions1
functions2
functions3
functions4
functions5
if1
if2
primitive_types1
primitive_types3
primitive_types4
primitive_types5
vecs1
vecs2
move_semantics1
move_semantics2
move_semantics3
move_semantics4
move_semantics5
move_semantics6
structs1
structs2
enums1
enums3
strings2
strings3
strings4
modules1
modules2
modules3
hashmaps1
hashmaps2
hashmaps3
options1
options2
options3
errors2
errors3
errors4
errors5
generics1
generics2
traits1
traits2
traits3
traits4
traits5
quiz3
lifetimes1
lifetimes2
lifetimes3
tests1
tests2
tests3
tests4
iterators1
iterators2
iterators3
iterators4
iterators5
box1
rc1
arc1
cow1
threads1
threads2
threads3
macros1
macros2
macros3
macros4
clippy1
clippy2
clippy3
using_as
from_into
from_str
try_from_into
as_ref_mut
Screenshots of the list.
Page 1:
Page 2:
Page 3
Only Pending:
Text content of the list (without the `next` column).
State Name Path
PENDING intro1 exercises/00_intro/intro1.rs
DONE intro2 exercises/00_intro/intro2.rs
DONE variables1 exercises/01_variables/variables1.rs
DONE variables2 exercises/01_variables/variables2.rs
DONE variables3 exercises/01_variables/variables3.rs
DONE variables4 exercises/01_variables/variables4.rs
DONE variables5 exercises/01_variables/variables5.rs
DONE variables6 exercises/01_variables/variables6.rs
DONE functions1 exercises/02_functions/functions1.rs
DONE functions2 exercises/02_functions/functions2.rs
DONE functions3 exercises/02_functions/functions3.rs
DONE functions4 exercises/02_functions/functions4.rs
DONE functions5 exercises/02_functions/functions5.rs
DONE if1 exercises/03_if/if1.rs
DONE if2 exercises/03_if/if2.rs
PENDING if3 exercises/03_if/if3.rs
PENDING quiz1 exercises/quizzes/quiz1.rs
DONE primitive_types1 exercises/04_primitive_types/primitive_types1.rs
PENDING primitive_types2 exercises/04_primitive_types/primitive_types2.rs
DONE primitive_types3 exercises/04_primitive_types/primitive_types3.rs
DONE primitive_types4 exercises/04_primitive_types/primitive_types4.rs
DONE primitive_types5 exercises/04_primitive_types/primitive_types5.rs
PENDING primitive_types6 exercises/04_primitive_types/primitive_types6.rs
DONE vecs1 exercises/05_vecs/vecs1.rs
DONE vecs2 exercises/05_vecs/vecs2.rs
DONE move_semantics1 exercises/06_move_semantics/move_semantics1.rs
DONE move_semantics2 exercises/06_move_semantics/move_semantics2.rs
DONE move_semantics3 exercises/06_move_semantics/move_semantics3.rs
DONE move_semantics4 exercises/06_move_semantics/move_semantics4.rs
DONE move_semantics5 exercises/06_move_semantics/move_semantics5.rs
DONE move_semantics6 exercises/06_move_semantics/move_semantics6.rs
DONE structs1 exercises/07_structs/structs1.rs
DONE structs2 exercises/07_structs/structs2.rs
PENDING structs3 exercises/07_structs/structs3.rs
DONE enums1 exercises/08_enums/enums1.rs
PENDING enums2 exercises/08_enums/enums2.rs
DONE enums3 exercises/08_enums/enums3.rs
PENDING strings1 exercises/09_strings/strings1.rs
DONE strings2 exercises/09_strings/strings2.rs
DONE strings3 exercises/09_strings/strings3.rs
DONE strings4 exercises/09_strings/strings4.rs
DONE modules1 exercises/10_modules/modules1.rs
DONE modules2 exercises/10_modules/modules2.rs
DONE modules3 exercises/10_modules/modules3.rs
DONE hashmaps1 exercises/11_hashmaps/hashmaps1.rs
DONE hashmaps2 exercises/11_hashmaps/hashmaps2.rs
DONE hashmaps3 exercises/11_hashmaps/hashmaps3.rs
PENDING quiz2 exercises/quizzes/quiz2.rs
DONE options1 exercises/12_options/options1.rs
DONE options2 exercises/12_options/options2.rs
DONE options3 exercises/12_options/options3.rs
PENDING errors1 exercises/13_error_handling/errors1.rs
DONE errors2 exercises/13_error_handling/errors2.rs
DONE errors3 exercises/13_error_handling/errors3.rs
DONE errors4 exercises/13_error_handling/errors4.rs
DONE errors5 exercises/13_error_handling/errors5.rs
PENDING errors6 exercises/13_error_handling/errors6.rs
DONE generics1 exercises/14_generics/generics1.rs
DONE generics2 exercises/14_generics/generics2.rs
DONE traits1 exercises/15_traits/traits1.rs
DONE traits2 exercises/15_traits/traits2.rs
DONE traits3 exercises/15_traits/traits3.rs
DONE traits4 exercises/15_traits/traits4.rs
DONE traits5 exercises/15_traits/traits5.rs
DONE quiz3 exercises/quizzes/quiz3.rs
DONE lifetimes1 exercises/16_lifetimes/lifetimes1.rs
DONE lifetimes2 exercises/16_lifetimes/lifetimes2.rs
DONE lifetimes3 exercises/16_lifetimes/lifetimes3.rs
DONE tests1 exercises/17_tests/tests1.rs
DONE tests2 exercises/17_tests/tests2.rs
DONE tests3 exercises/17_tests/tests3.rs
DONE tests4 exercises/17_tests/tests4.rs
DONE iterators1 exercises/18_iterators/iterators1.rs
DONE iterators2 exercises/18_iterators/iterators2.rs
DONE iterators3 exercises/18_iterators/iterators3.rs
DONE iterators4 exercises/18_iterators/iterators4.rs
DONE iterators5 exercises/18_iterators/iterators5.rs
DONE box1 exercises/19_smart_pointers/box1.rs
DONE rc1 exercises/19_smart_pointers/rc1.rs
DONE arc1 exercises/19_smart_pointers/arc1.rs
DONE cow1 exercises/19_smart_pointers/cow1.rs
DONE threads1 exercises/20_threads/threads1.rs
DONE threads2 exercises/20_threads/threads2.rs
DONE threads3 exercises/20_threads/threads3.rs
DONE macros1 exercises/21_macros/macros1.rs
DONE macros2 exercises/21_macros/macros2.rs
DONE macros3 exercises/21_macros/macros3.rs
DONE macros4 exercises/21_macros/macros4.rs
DONE clippy1 exercises/22_clippy/clippy1.rs
DONE clippy2 exercises/22_clippy/clippy2.rs
DONE clippy3 exercises/22_clippy/clippy3.rs
DONE using_as exercises/23_conversions/using_as.rs
DONE from_into exercises/23_conversions/from_into.rs
DONE from_str exercises/23_conversions/from_str.rs
DONE try_from_into exercises/23_conversions/try_from_into.rs
DONE as_ref_mut exercises/23_conversions/as_ref_mut.rs
This are my local files (after cargo clean
and removing the .git
directory).
This happened when I pressed next
+ Enter three times:
https://github.com/rust-lang/rustlings/assets/8530833/f869437a-5812-47be-8450-60c04b7920b9
Would it be possible to keep around nix as an installation method in v6?
Would it be possible to keep around nix as an installation method in v6?
No, because I don't use Nix and will not maintain it. You can package it then because v6 will be a standalone binary that you can install with cargo install rustlings
.
exercises\02_functions\functions1.rs
: Add// don't change this line
aftercall_me();
. Make it clear to write the function (and not to remove the call).
I was taking a look at exercises/02_functions/functions1.rs
just now and I'm glad you said this. It wasn't clear what the reader is expected to do.
It might also be helpful to have an "ideal solution" for each exercise.
It might also be helpful to have an "ideal solution" for each exercise.
This is one of the main features of v6 :D
Handling solutions is already implemented. I just need to find some time to write the solutions: https://github.com/rust-lang/rustlings/tree/v6/solutions
It might also be helpful to have an "ideal solution" for each exercise.
This is one of the main features of v6 :D
Handling solutions is already implemented. I just need to find some time to write the solutions: https://github.com/rust-lang/rustlings/tree/v6/solutions
Oh, nice! I think I can try contributing to that if it goes in a pull request.
Also, I think it'd be neat if users had an option to automatically open the next exercise in their editor after completing the current one.
Oh, nice! I think I can try contributing to that if it goes in a pull request.
I plan to write them myself first and then improvements are welcome :D
Also, I think it'd be neat if users had an option to automatically open the next exercise in their editor after completing the current one.
This should also be partially solved since v6 shows you the path of the next exercise as a link in your terminal. Clicking on the link opens the file in your editor. The idea of automatically opening the current file is discarded because it can't work in terminal editor like Helix for example.
3) Invisible input text
I didn't find a way to really fix it, but now (beta.8
) Rustlings expects a single character as input. This means that entering h
will not show you that h
was entered, but it will react to it and show you the hint. You don't have to press ENTER anymore on Windows.
5) Quiz / 6) Progress bar
Thank you for sharing all the info. This looks good to me! (not a bug, but a source of confusion) Rustlings tells you that some exercises are still pending and goes back to them to let you finish them.
The reason why some exercises like quiz1
were not shown to you in the right order is that you jumped to the next file without entering n
for telling Rustlings to go to the next exercise.
For example, your list shows that if3
and quiz1
are pending. quiz1
comes directly after if3
, but you probably didn't enter n
after finishing if3
and instead started editing the file for primitive_types1
. Rustlings jumps to the file that was lastly saved.
This was fine before having the interactive list. But now that the list exists and allows you to opt into skipping an exercise, I think we should disable skipping on saving the file of a later exercise. Going back is fine though. I will implement this in the next beta version :)
Thank you again @dotjpg3141 🥰
But now that the list exists and allows you to opt into skipping an exercise, I think we should disable skipping on saving the file of a later exercise. Going back is fine though.
Done in beta.9
:D
Love the new direction rustlings is taking! One issue I'm having: After starting rustlings, I get an "invalid argument" for running the intro1 command and rustlings exists.
@vgroenewold I don't have enough information to reproduce this. Could you please tell me what command you tried to run and in which directory? Could you please share the exact error message? Thanks 😊
The reason why some exercises like
quiz1
were not shown to you in the right order is that you jumped to the next file without entering n for telling Rustlings to go to the next exercise.
That makes a lot of sense. This is probably what happened.