Commit Graph

1065 Commits

Author SHA1 Message Date
bors 426a7bb87f Auto merge of #249 - AbdouSeck:conversions, r=fmoko
feat: Add type conversion and parsing exercises

This pull request adds exercises for converting values into specific types. The exercises uses string to struct type conversions, but most of the traits in the exercises can handle more than just string parsing and conversions.

The following traits are covered:
1. `From` and `Into`
2. `TryFrom` and `TryInto`
3. `AsRef`
4. `FromStr`

The `as` operator is also covered.
2019-12-16 16:41:03 +00:00
Abdou Seck fc26b5e151 I AM NOT DONE comment in conversions exercise files 2019-12-16 11:33:00 -05:00
Abdou Seck 0c85dc1193 feat: Add type conversion and parsing exercises 2019-12-16 09:12:13 -05:00
marisa fe10e06c37
fix(tests1): Change test command
Closes #243.
2019-12-16 13:05:25 +01:00
marisa 419f7797f2
fix(iterators2): Remove reference to missing iterators2.rs (#245)
fix(iterators2): Remove reference to missing iterators2.rs
2019-12-16 12:51:03 +01:00
Rahat Ahmed 54571a5fca
fix(iterators2): Remove reference to missing iterators2.rs 2019-12-07 23:25:13 -08:00
marisa 4b79691d5e 2.1.0 2019-11-27 10:46:09 +01:00
marisa 615ce32798
fix(enums): Add link to chapter on pattern syntax (#242)
Add link to chapter on pattern syntax
2019-11-25 12:16:51 +00:00
Jens 31c25ebb50
Add link to chapter on pattern syntax
After being stuck on exercise enums3.rs for about an hour or two, having read the entire chapter on enums 2-3 times, and still being unable to complete the exercise, i started broadening my reading. I finally found the answer in the rust docs via google.
2019-11-24 09:28:33 +01:00
bors f4acb888a6 Auto merge of #241 - vyaslav:master, r=fmoko
feat(watch): show hint while watching

`rustlings hint ...` command is not convenient when doing exercises with `rustlings watch`.
This PR makes it possible for user to type `hint` while running `watch`  and get hint text for exercise which is currently failing.
e.g.
```rust
...
  --> exercises/variables/variables1.rs:13:36
   |
13 |     println!("x has the value {}", x);
   |                                    ^ not found in this scope

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0425`.

type 'hint' to get help:
hint
Hint: The declaration on line 12 is missing a keyword that is needed in Rust
to create a new variable binding.
```
2019-11-18 22:23:14 +00:00
vyaslav 8143d57b4e feat(watch): show hint while watching 2019-11-18 20:52:57 +01:00
bors a40ad092e9 Auto merge of #239 - jrvidal:master, r=fmoko
fix: line numbers in several exercises and hints

The introduction of `I AM NOT DONE` shifted the lines of all exercises, which now need adjustment.
2019-11-14 08:23:50 +00:00
Roberto Vidal b565c4d3e7 fix: line numbers in several exercises and hints
The introduction of `I AM NOT DONE` shifted the lines of all
exercises, which now need adjustment.
2019-11-14 08:21:56 +01:00
bors e9a835c1c0 Auto merge of #237 - ckeschnat:master, r=fmoko
fix(variables1): Correct wrong word in comment
2019-11-13 23:45:56 +00:00
bors cf38f03459 Auto merge of #238 - ageorgou:functions4-update, r=fmoko
Update line numbers in hints and outdated comment

In functions4, the missing code is in line 14 in the latest version:
```rust
error: expected type, found `{`
  --> exercises/functions/functions4.rs:14:30
   |
14 | fn sale_price(price: i32) -> {
   |                              ^ expected type

error: aborting due to previous error
```
but the hint points to line 12. This is due to a recent change in 2cdd61294f.

Also includes similar updates for strings2 and primitive_types4.
2019-11-13 23:41:00 +00:00
Anastasis Georgoulas 4c5189df2b fix(primitive_types4): update outdated hint
Exercise was changed to test (and the order was switched) in #209.
2019-11-13 23:23:34 +00:00
Anastasis Georgoulas a09f684f05 fix(strings2): update line number in hint 2019-11-13 23:23:34 +00:00
ageorgou 8cc5af121c
Fix(functions4): Update line number in hint 2019-11-12 23:49:19 +00:00
Chris Keschnat c42c3b2101
fix(arc1): Fix some words in the comment 2019-11-12 18:37:23 +01:00
Chris Keschnat fda5a47069 fix(variables1): Correct wrong word in comment 2019-11-12 17:33:25 +01:00
marisa 57a837bde6
Merge pull request #236 from jrvidal/master
fix(primitive_types4): update outdated comment
2019-11-12 13:00:28 +01:00
Roberto Vidal ded2c034ba fix(primitive_types4): update outdated comment 2019-11-12 12:52:28 +01:00
marisa eac07df96c 2.0.0 2019-11-12 12:24:30 +01:00
bors 8c1376df07 Auto merge of #235 - rust-lang:fmoko-patch-1, r=fmoko
fix(default): Clarify the installation procedure
2019-11-12 11:13:06 +00:00
bors 45d68d9b39 Auto merge of #232 - rust-lang:update-docs, r=fmoko
chore: Update docs for 2.0

Only merge this once we're ready to release 2.0.
2019-11-12 11:07:56 +00:00
marisa c371b853af
fix(default): Clarify the installation procedure 2019-11-12 11:53:58 +01:00
bors bc32a63c69 Auto merge of #234 - jrvidal:no-prompt-on-run, r=fmoko
fix(run): makes `run` never prompt

`watch` and `verify` do prompt the user to actively move to the
next exercise. This change fixes `run` to never prompt. Previously
it was inconsistent between "test" and "compile" exercises.

BREAKING CHANGE: we again change the behavior of the `run` command
2019-11-12 10:50:19 +00:00
Roberto Vidal 4b26546589 fix(run): makes `run` never prompt
`watch` and `verify` do prompt the user to actively move to the
next exercise. This change fixes `run` to never prompt. Previously
it was inconsistent between "test" and "compile" exercises.

BREAKING CHANGE: we again change the behavior of the `run` command
2019-11-12 11:35:40 +01:00
bors bc56788fe6 Auto merge of #233 - jrvidal:rustc-check, r=fmoko
feat(cli): check for rustc before doing anything

Addresses #190. From the backtraces shown there, it seems like we're not able to launch `rustc` (which is odd, given that they probably compiled and installed `rustlings` 🤷‍♀️)
2019-11-11 18:19:07 +00:00
marisa b4d41c1b7a chore: Update docs for 2.0 2019-11-11 18:02:56 +01:00
Roberto Vidal 36a033b87a feat(cli): check for rustc before doing anything
Addresses #190.
2019-11-11 18:00:54 +01:00
bors 9544ba1029 Auto merge of #231 - rust-lang:refactor-hints, r=jrvidal
Refactor hints

Breaking change. This removes hints from the end of files, and puts them into `info.toml`. You can now access hints using:

```
rustlings hint <exerciseName>
```

ALSO this changes the exercise system to index by name for `run` and `hint`, so:

```
rustlings run exercises/if/if1.rs
```

becomes

```
rustlings run if1
```
2019-11-11 16:51:12 +00:00
marisa 1a7bb5a400 Address feedback 2019-11-11 17:47:45 +01:00
marisa 48c35bcfbc fix tests 2019-11-11 17:28:19 +01:00
marisa ec2d4bd3ee
Merge branch 'master' into refactor-hints 2019-11-11 17:21:06 +01:00
marisa ce9fa6ebbf feat(hint): Add test for hint 2019-11-11 17:19:50 +01:00
marisa 9a9007abae chore: Add .editorconfig file 2019-11-11 17:12:11 +01:00
bors 88ec6f6b16 Auto merge of #230 - jrvidal:master, r=fmoko
Changes the execution mode for `watch`, asking for user input

We've [observed](https://hackmd.io/-cK6aPhnTwiCiI7u6k0xug?both) that learners can get confused when they do get everything right, but they _still_ get errors... which come from the next exercise, no the one they just edited.

This PR changes it so they have to confirm they want to move forward by removing the `I AM NOT DONE` comment.

![Screenshot at 2019-11-11 15:13:39](https://user-images.githubusercontent.com/1636604/68593566-0abd3900-0496-11ea-9e9d-6c43b91bf21d.png)

* [ ] The particular string is of course subject to bikeshed.

### Alternatives/doubts
* The coolest solution I could imagine would involve a proc-macro attribute `#![ready(false)]` that they could edit once they're done, but it's a bit complicated to set up.
* For now I've put `I AM NOT DONE` everywhere, I think it's what make more sense.
2019-11-11 15:59:35 +00:00
marisa 795b6e3480 fix(info): Fix trailing newlines for hints 2019-11-11 16:56:39 +01:00
marisa 9bdb0a12e4 feat: Refactor hint system
Hints are now accessible using the CLI subcommand `rustlings hint
<exercise name`.

BREAKING CHANGE: This fundamentally changes the way people interact with exercises.
2019-11-11 16:51:38 +01:00
Roberto Vidal 2cdd61294f feat: improve `watch` execution mode
The `watch` command now requires user action to move to the next
exercise.

BREAKING CHANGE: this changes the behavior of `watch`.
2019-11-11 16:23:35 +01:00
marisa 627cdc07d0 feat: Index exercises by name
BREAKING CHANGE: This changes the way you use `rustlings run` by now
requiring an abridged form of the previous filename, e.g:

`rustlings run exercises/if/if1.rs` becomes
`rustlings run if1`
2019-11-11 15:46:32 +01:00
marisa a47a62172a 1.5.1 2019-11-11 14:02:27 +01:00
marisa f72e5a8f05 fix(structs1): Remove misleading comment 2019-11-11 13:57:59 +01:00
marisa fbe91a67a4 fix(threads): Move Threads behind SLT
Closes #205.
2019-11-11 13:48:09 +01:00
marisa 6dcecb38a4 fix(strings): Move Strings before Structs
Closes #204.
2019-11-11 13:46:42 +01:00
marisa dcfb427b09 fix(errors3): Update hint
Closes #185.
2019-11-11 13:37:43 +01:00
marisa ad03d180c9 fix(if1): Remove `return` reference
This closes #153.
2019-11-11 13:34:21 +01:00
bors 3232a4d60d Auto merge of #228 - WofWca:clear-screen, r=fmoko
improvement(watch): clear screen before each `verify()`

Closes #146
It seems to me that #227 wasn't really fixing the issue.
2019-11-09 15:23:53 +00:00
WofWca 3aff590855 improvement(watch): clear screen before each `verify()`
Closes #146
2019-11-09 22:24:24 +08:00