The Wayback Machine - https://web.archive.org/web/20201228102020/https://github.com/rust-lang/rustlings/issues/585
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`as_ref_mut` not ran #585

Open
AntonOellerer opened this issue Nov 9, 2020 · 2 comments · May be fixed by #599
Open

`as_ref_mut` not ran #585

AntonOellerer opened this issue Nov 9, 2020 · 2 comments · May be fixed by #599

Comments

@AntonOellerer
Copy link

@AntonOellerer AntonOellerer commented Nov 9, 2020

Hey,
First of all, thank you very much for this instructive course, which helped me to get back into rust very fast.
I noticed that, when I finished the second-to-last exercise, from_str, that rustlings watch immediately told me that I was finished, although I did not touch as_ref_mut. Do you know why that might be?
I am running rustlings 4.1.0 and rustc 1.47.0
Best regards
Anton

@AbdouSeck
Copy link
Collaborator

@AbdouSeck AbdouSeck commented Dec 7, 2020

Hi @AntonOellerer thanks for bringing this up. I am not able to reproduce this issue. I have used rustlings run as_ref_mut on both versions 4.1.0 and 4.2.0. My rustc is also rustc 1.47.0 (18bf6b4f0 2020-10-07).

But can you please try all the the following and report your findings?

  • rustlings run as_ref_mut => This should tell you whether or not the exercise is solved
  • rustlings watch => This is normally wrap up the watching you've got nothing left to solve
  • rustlings verify => This should do the same thing as the second suggestion

You could also upgrade version 4.2.0.

Thanks,
Abdou

@AbdouSeck AbdouSeck self-assigned this Dec 8, 2020
@AbdouSeck
Copy link
Collaborator

@AbdouSeck AbdouSeck commented Dec 12, 2020

@AntonOellerer I was able to reproduce this issue. It seems like it does not have to do with the exercise itself but rather it's related to the way the rustlings decides when all the exercises have been completed. But since the conversions exercises are the last ones listed in the info.toml file, rustlings will decide that you have completed all the exercises, just because you completed the ones listed last in the info.toml. This is a bug.

At first inspection, it looks like the bug is caused by this line that tries to fetch the pending exercises. That line basically fetches exercises that come after the most recently modified file. So, it assumes (wrongly) that you are following the order of exercises presented to you by the watch command.

In sum, the bug is reproducible if the user ignores the ordering provided by the watch command. If the last exercise listed in the info.toml file is solved and saved, then watch will get fooled into thinking that all the exercises have been solved. The same issue was reported in #465.

I am working on a fix and will update this issue when the issue has been resolved.

Thanks,
Abdou

AbdouSeck added a commit to AbdouSeck/rustlings that referenced this issue Dec 12, 2020
1.
`rustlings list` should now display more than just the exercise names.
Information such as file paths and exercises statuses should be displayed.
The `--paths` option limits the displayed fields to only the path names; while the `--names`
option limits the displayed fields to only exercise names.
You can also control which exercises are displayed, by using the `--filter` option, or
the `--solved` or `--unsolved` flags.

Some use cases:
- Fetching pending exercise files with the keyword "conversion" to pass to my editor:
```sh
vim $(rustlings list --filter "conversion" --paths --unsolved)
```

- Fetching exercise names with keyword "conversion" to pass to `rustlings run`:
```sh
for exercise in $(rustlings list --filter "conversion" --names)
do
    rustlings run ${exercise}
done
```

2.
This should also fix rust-lang#465, and will likely fix rust-lang#585, as well.
That bug mentioned in those issues has to do with the way the `watch` command handler fetches the pending exercises.
Going forward, the least recently updated exercises along with all the other exercises in a pending state are fetched.
AbdouSeck added a commit to AbdouSeck/rustlings that referenced this issue Dec 13, 2020
1.
`rustlings list` should now display more than just the exercise names.
Information such as file paths and exercises statuses should be displayed.
The `--paths` option limits the displayed fields to only the path names; while the `--names`
option limits the displayed fields to only exercise names.
You can also control which exercises are displayed, by using the `--filter` option, or
the `--solved` or `--unsolved` flags.

Some use cases:
- Fetching pending exercise files with the keyword "conversion" to pass to my editor:
```sh
vim $(rustlings list --filter "conversion" --paths --unsolved)
```

- Fetching exercise names with keyword "conversion" to pass to `rustlings run`:
```sh
for exercise in $(rustlings list --filter "conversion" --names)
do
    rustlings run ${exercise}
done
```

2.
This should also fix rust-lang#465, and will likely fix rust-lang#585, as well.
That bug mentioned in those issues has to do with the way the `watch` command handler fetches the pending exercises.
Going forward, the least recently updated exercises along with all the other exercises in a pending state are fetched.
AbdouSeck added a commit to AbdouSeck/rustlings that referenced this issue Dec 13, 2020
1.
`rustlings list` should now display more than just the exercise names.
Information such as file paths and exercises statuses should be displayed.
The `--paths` option limits the displayed fields to only the path names; while the `--names`
option limits the displayed fields to only exercise names.
You can also control which exercises are displayed, by using the `--filter` option, or
the `--solved` or `--unsolved` flags.

Some use cases:
- Fetching pending exercise files with the keyword "conversion" to pass to my editor:
```sh
vim $(rustlings list --filter "conversion" --paths --unsolved)
```

- Fetching exercise names with keyword "conversion" to pass to `rustlings run`:
```sh
for exercise in $(rustlings list --filter "conversion" --names)
do
    rustlings run ${exercise}
done
```

2.
This should also fix rust-lang#465, and will likely fix rust-lang#585, as well.
That bug mentioned in those issues has to do with the way the `watch` command handler fetches the pending exercises.
Going forward, the least recently updated exercises along with all the other exercises in a pending state are fetched.
AbdouSeck added a commit to AbdouSeck/rustlings that referenced this issue Dec 15, 2020
1.
`rustlings list` should now display more than just the exercise names.
Information such as file paths and exercises statuses should be displayed.
The `--paths` option limits the displayed fields to only the path names; while the `--names`
option limits the displayed fields to only exercise names.
You can also control which exercises are displayed, by using the `--filter` option, or
the `--solved` or `--unsolved` flags.

Some use cases:
- Fetching pending exercise files with the keyword "conversion" to pass to my editor:
```sh
vim $(rustlings list --filter "conversion" --paths --unsolved)
```

- Fetching exercise names with keyword "conversion" to pass to `rustlings run`:
```sh
for exercise in $(rustlings list --filter "conversion" --names)
do
    rustlings run ${exercise}
done
```

2.
This should also fix rust-lang#465, and will likely fix rust-lang#585, as well.
That bug mentioned in those issues has to do with the way the `watch` command handler fetches the pending exercises.
Going forward, the least recently updated exercises along with all the other exercises in a pending state are fetched.
AbdouSeck added a commit to AbdouSeck/rustlings that referenced this issue Dec 16, 2020
1.
`rustlings list` should now display more than just the exercise names.
Information such as file paths and exercises statuses should be displayed.
The `--paths` option limits the displayed fields to only the path names; while the `--names`
option limits the displayed fields to only exercise names.
You can also control which exercises are displayed, by using the `--filter` option, or
the `--solved` or `--unsolved` flags.

Some use cases:
- Fetching pending exercise files with the keyword "conversion" to pass to my editor:
```sh
vim $(rustlings list --filter "conversion" --paths --unsolved)
```

- Fetching exercise names with keyword "conversion" to pass to `rustlings run`:
```sh
for exercise in $(rustlings list --filter "conversion" --names)
do
    rustlings run ${exercise}
done
```

2.
This should also fix rust-lang#465, and will likely fix rust-lang#585, as well.
That bug mentioned in those issues has to do with the way the `watch` command handler fetches the pending exercises.
Going forward, the least recently updated exercises along with all the other exercises in a pending state are fetched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.