Skip to content

Commit c791cf4

Browse files
committed
Merge branch '5.0-dev'
2 parents f1c4caa + c265b68 commit c791cf4

File tree

134 files changed

+1273
-1049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1273
-1049
lines changed

.github/workflows/rust.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Rustlings Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Build
18+
run: cargo build --verbose
19+
- name: Run tests
20+
run: cargo test --verbose

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ rust-project.json
99
.idea
1010
.vscode
1111
*.iml
12+
*.o

CONTRIBUTING.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ _implement a new feature! ➡️ [open an Issue to discuss it first, then a Pull
2121

2222
`rustlings` is basically a glorified `rustc` wrapper. Therefore the source code
2323
isn't really that complicated since the bulk of the work is done by `rustc`.
24-
`src/main.rs` contains a simple `clap` CLI that loads from `src/verify.rs` and `src/run.rs`.
24+
`src/main.rs` contains a simple `argh` CLI that connects to most of the other source files.
2525

2626
<a name="addex"></a>
2727
### Adding an exercise
2828

2929
The first step is to add the exercise! Name the file `exercises/yourTopic/yourTopicN.rs`, make sure to
3030
put in some helpful links, and link to sections of the book in `exercises/yourTopic/README.md`.
3131

32-
Next make sure it runs with `rustlings`. The exercise metadata is stored in `info.toml`, under the `exercises` array. The order of the `exercises` array determines the order the exercises are run by `rustlings verify`.
32+
Next make sure it runs with `rustlings`. The exercise metadata is stored in `info.toml`, under the `exercises` array. The order of the `exercises` array determines the order the exercises are run by `rustlings verify` and `rustlings watch`.
3333

3434
Add the metadata for your exercise in the correct order in the `exercises` array. If you are unsure of the correct ordering, add it at the bottom and ask in your pull request. The exercise metadata should contain the following:
3535
```diff
@@ -43,7 +43,7 @@ Add the metadata for your exercise in the correct order in the `exercises` array
4343
...
4444
```
4545

46-
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`.
46+
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`. If you're working on a Clippy exercise, use `mode = "clippy"`.
4747

4848
That's all! Feel free to put up a pull request.
4949

@@ -67,19 +67,19 @@ changes. There's a couple of things to watch out for:
6767
#### Write correct commit messages
6868

6969
We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/)
70-
specification, because it makes it easier to generate changelogs automatically.
70+
specification.
7171
This means that you have to format your commit messages in a specific way. Say
7272
you're working on adding a new exercise called `foobar1.rs`. You could write
7373
the following commit message:
7474

7575
```
76-
feat: Add foobar1.rs exercise
76+
feat: add foobar1.rs exercise
7777
```
7878

7979
If you're just fixing a bug, please use the `fix` type:
8080

8181
```
82-
fix(verify): Make sure verify doesn't self-destruct
82+
fix(verify): make sure verify doesn't self-destruct
8383
```
8484

8585
The scope within the brackets is optional, but should be any of these:
@@ -96,36 +96,35 @@ When the commit also happens to close an existing issue, link it in the message
9696
body:
9797

9898
```
99-
fix: Update foobar
99+
fix: update foobar
100100
101101
closes #101029908
102102
```
103103

104104
If you're doing simple changes, like updating a book link, use `chore`:
105105

106106
```
107-
chore: Update exercise1.rs book link
107+
chore: update exercise1.rs book link
108108
```
109109

110110
If you're updating documentation, use `docs`:
111111

112112
```
113-
docs: Add more information to Readme
113+
docs: add more information to Readme
114114
```
115115

116116
If, and only if, you're absolutely sure you want to make a breaking change
117117
(please discuss this beforehand!), add an exclamation mark to the type and
118118
explain the breaking change in the message body:
119119

120120
```
121-
fix!: Completely change verification
121+
fix!: completely change verification
122122
123123
BREAKING CHANGE: This has to be done because lorem ipsum dolor
124124
```
125125

126126
#### Pull Request Workflow
127127

128128
Once you open a Pull Request, it may be reviewed or labeled (or both) until
129-
the maintainers accept your change. Then, [bors](https://github.com/bors) will
130-
run the test suite with your changes and if it's successful, automatically
131-
merge it in!
129+
the maintainers accept your change. Please be patient, it may take some time
130+
for this to happen!

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustlings"
33
version = "4.8.0"
4-
authors = ["mokou <mokou@fastmail.com>", "Carol (Nichols || Goulding) <carol.nichols@gmail.com>"]
4+
authors = ["Liv <mokou@fastmail.com>", "Carol (Nichols || Goulding) <carol.nichols@gmail.com>"]
55
edition = "2021"
66

77
[dependencies]
@@ -24,6 +24,3 @@ path = "src/main.rs"
2424
assert_cmd = "0.11.0"
2525
predicates = "1.0.1"
2626
glob = "0.3.0"
27-
28-
[features]
29-
exercises = []

README.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ Start-BitsTransfer -Source https://raw.githubusercontent.com/rust-lang/rustlings
4444

4545
To install Rustlings. Same as on MacOS/Linux, you will have access to the `rustlings` command after it.
4646

47-
When you get a permission denied message then you have to exclude the directory where you placed the rustlings in your virus-scanner
47+
If you get a permission denied message, you might have to exclude the directory where you cloned Rustlings in your antivirus.
4848

49-
## Browser:
49+
## Browser
5050

5151
[Run on Repl.it](https://repl.it/github/rust-lang/rustlings)
5252

@@ -150,24 +150,6 @@ cargo uninstall rustlings
150150

151151
Now you should be done!
152152

153-
## Completion
154-
155-
Rustlings isn't done; there are a couple of sections that are very experimental and don't have proper documentation. These include:
156-
157-
- Errors (`exercises/errors/`)
158-
- Option (`exercises/option/`)
159-
- Result (`exercises/result/`)
160-
- Move Semantics (could still be improved, `exercises/move_semantics/`)
161-
162-
Additionally, we could use exercises on a couple of topics:
163-
164-
- Structs
165-
- Better ownership stuff
166-
- `impl`
167-
- ??? probably more
168-
169-
If you are interested in improving or adding new ones, please feel free to contribute! Read on for more information :)
170-
171153
## Contributing
172154

173155
See [CONTRIBUTING.md](./CONTRIBUTING.md).

exercises/advanced_errors/advanced_errs1.rs

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)