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

Refactor hints #231

Merged
merged 7 commits into from Nov 11, 2019
Merged

Refactor hints #231

merged 7 commits into from Nov 11, 2019

Conversation

shadows-withal
Copy link
Member

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

marisa added 3 commits November 11, 2019 15:46
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`
Hints are now accessible using the CLI subcommand `rustlings hint
<exercise name`.

BREAKING CHANGE: This fundamentally changes the way people interact with exercises.
@bors bors added S-waiting-on-bors S-waiting-on-author Status: Waiting on issue/PR author and removed S-waiting-on-bors labels Nov 11, 2019
@rust-lang rust-lang deleted a comment from bors Nov 11, 2019
@bors
Copy link
Contributor

bors commented Nov 11, 2019

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Nov 11, 2019

📌 Commit 795b6e3 has been approved by jrvidal

@bors bors added S-waiting-on-bors and removed S-waiting-on-author Status: Waiting on issue/PR author labels Nov 11, 2019
@shadows-withal
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: Waiting on issue/PR author and removed S-waiting-on-bors labels Nov 11, 2019
@shadows-withal
Copy link
Member Author

Also closes #203.

Copy link
Contributor

@jrvidal jrvidal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments

src/main.rs Outdated Show resolved Hide resolved

let exercise = exercises.iter().find(matching_exercise).unwrap_or_else(|| {
println!("No exercise found for your file name!");
println!("No exercise found for your given name!");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we rely on exercise names, I wonder whether there should be a test to check that exercise names are unique.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, but it'd be out of scope for this PR

exercises/error_handling/errorsn.rs Outdated Show resolved Hide resolved
exercises/error_handling/result1.rs Outdated Show resolved Hide resolved
exercises/functions/functions1.rs Outdated Show resolved Hide resolved
info.toml Outdated Show resolved Hide resolved
info.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@jrvidal jrvidal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shadows-withal
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Nov 11, 2019

📌 Commit 1a7bb5a has been approved by fmoko

@bors bors added S-waiting-on-bors and removed S-waiting-on-author Status: Waiting on issue/PR author labels Nov 11, 2019
@shadows-withal
Copy link
Member Author

@bors r-

@bors
Copy link
Contributor

bors commented Nov 11, 2019

⌛ Testing commit 1a7bb5a with merge fdf6a13...

bors added a commit that referenced this pull request Nov 11, 2019
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
```
@bors bors added S-waiting-on-author Status: Waiting on issue/PR author and removed S-waiting-on-bors labels Nov 11, 2019
@shadows-withal
Copy link
Member Author

@bors r=jrvidal

@bors
Copy link
Contributor

bors commented Nov 11, 2019

📌 Commit 1a7bb5a has been approved by jrvidal

@bors bors added S-waiting-on-bors and removed S-waiting-on-author Status: Waiting on issue/PR author labels Nov 11, 2019
@bors
Copy link
Contributor

bors commented Nov 11, 2019

⌛ Testing commit 1a7bb5a with merge 9544ba1...

bors added a commit that referenced this pull request Nov 11, 2019
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
```
@bors
Copy link
Contributor

bors commented Nov 11, 2019

☀️ Test successful - checks-travis
Approved by: jrvidal
Pushing 9544ba1 to master...

@bors bors merged commit 1a7bb5a into master Nov 11, 2019
@shadows-withal shadows-withal deleted the refactor-hints branch November 12, 2019 11:19
pedantic79 pushed a commit to pedantic79/rustlings that referenced this pull request Apr 11, 2020
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
```
ppp3 pushed a commit to ppp3/rustlings that referenced this pull request May 23, 2022
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
```
dmoore04 pushed a commit to dmoore04/rustlings that referenced this pull request Sep 11, 2022
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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants