Skip to content

Commit 10d4d61

Browse files
committed
rework contribution guide for the new toml file
1 parent 70e59cc commit 10d4d61

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,20 @@ If you are interested in improving or adding new ones, please feel free to contr
105105
First step is to add the exercise! Call it `exercises/yourTopic/yourTopicN.rs`, make sure to
106106
put in some helpful links, and link to sections of the book in `exercises/yourTopic/README.md`.
107107

108-
Then, you'll want to make sure it gets verified when you run `rustlings verify`. Open `src/verify.rs` and
109-
put your exercise somewhere in there:
108+
Next you want to make sure it runs when using `rustlings`. All exercises are stored in `info.toml`, under the `exercises` array. They're ordered by the order they're ran when using `rustlings verify`.
110109

110+
You want to make sure where in the file you add your exercise. If you're not sure, add it at the bottom and ask in your pull request. To add an exercise, edit the file like this:
111111
```diff
112112
...
113-
compile_only("exercises/functions5.rs")?;
114-
+ compile_only("exercises/yourTopic/yourTopicN.rs")?;
115-
compile_only("exercises/test1.rs")?;
113+
+ [[exercises]]
114+
+ path = "exercises/yourTopic/yourTopicN.rs"
115+
+ mode = "compile"
116116
...
117117
```
118118

119-
That's all!
119+
The `mode` attribute decides whether Rustlings will only compile your exercise, or compile and test it. If you have tests to verify in your exercise, choose `test`, otherwise `compile`.
120+
121+
That's all! Feel free to put up a pull request.
120122

121123
### Working on the source code
122124

0 commit comments

Comments
 (0)