Commit Graph

309 Commits (b8d59d699bed76b6be95d1ed41881d00d4b0d533)
 

Author SHA1 Message Date
bors b8d59d699b Auto merge of #169 - miller-time:fix-install-script, r=komaeda
fix(installation): Fix rustlings installation check

fixes #147

I did some quick testing with the `-x` check:

```sh
if [ -x "$(notrustlings)" ]
then
    echo "notrustlings does not exist"
else
    echo "notrustlings appears to exist!"
    notrustlings
fi
```

which produced:

```
./test.sh: line 12: notrustlings: command not found
notrustlings appears to exist!
./test.sh: line 17: notrustlings: command not found
```

(consistent with comments in issue)

Using `if ! [ -x "$(command -v <command>)" ]` appears to be the standard way to perform this type of check.
5 years ago
bors 5586613eec Auto merge of #170 - miller-time:rename-iterator-exercise, r=komaeda
fix(iterators): Rename iterator3.rs

fixes #155
5 years ago
bors ad8e6dc63b Auto merge of #176 - danwilhelm:dan-minor-text, r=komaeda
chore: Minor text updates

- Make the default rustlings executable text consistent with the README and install script by adding `--force`.

- Remove a missed highlighting character from Issue #133.
5 years ago
Dan Wilhelm f72e0ca979 chore: Remove missed highlighting char from Issue #133 5 years ago
Dan Wilhelm 03cfe67500 chore: Make install instructions consistent 5 years ago
Russell Cousineau 7a252c4755 fix(installation): Fix rustlings installation check 5 years ago
liv 2089901739 docs: Move content from Readme to Contributing 5 years ago
liv 635e506c16 docs: Recommend `rustlings watch` as default 5 years ago
liv 75d8c7e3cc docs: Add CONTRIBUTING.md 5 years ago
Rohan Prinja 080d6cdd11 chore: Fix link to Arc<T> in the book 5 years ago
Russell Cousineau 433d2115bc fix(iterators): Rename iterator3.rs 5 years ago
liv 34e31232df feat(changelog): Use clog for changelogs 5 years ago
liv 7fca1d28af 1.3.0 5 years ago
bors 9c3d765403 Auto merge of #167 - rust-lang:fix/remove-highlighting, r=komaeda
Remove highlighting and syntect

Closes #166 and #122
5 years ago
liv bb652ceb91 Commit Cargo.lock file 5 years ago
liv 62696f5819 Remove highlighting and syntect 5 years ago
bors 41170ce341 Auto merge of #164 - HanKruiger:master, r=komaeda
Fix broken link
5 years ago
bors e2092a4ddd Auto merge of #165 - gushroom:fix-outdated-links, r=komaeda
fixed outdated links

The links had the 2018 book in them and they were outdated.
5 years ago
gushroom fd1441d122 fixed outdated links 5 years ago
HanKruiger e1422c6443 Fix broken link 5 years ago
bors 1f07fd4150 Auto merge of #163 - briankung:add_structs, r=komaeda
Adds a simple exercise for structures

Thanks for rustlings! Here's a small contribution in return.
5 years ago
Brian Kung 9b92aa08ae Adds a simple exercise for structures 5 years ago
bors 8bf8cbbd61 Auto merge of #162 - c-rustacean:rustfmt-and-ws-fixes, r=komaeda
errorsn.rs: Separate also the hints from each other to avoid accidental viewing
5 years ago
Eddy Petrisor f507844102 errorsn.rs: Separate also the hints from each other to avoid accidental viewing
Signed-off-by: Eddy Petrisor <eddy.petrisor@gmail.com>
5 years ago
bors fffbb60ed9 Auto merge of #161 - c-rustacean:rustfmt-and-ws-fixes, r=komaeda
Rustfmt and ws fixes
5 years ago
Eddy Petrisor 9aec4abc4d rustfmt the exercises
Signed-off-by: Eddy Petrisor <eddy.petrisor@gmail.com>
5 years ago
Eddy Petrisor a53b3f199f iterator3.rs: whitespace fixes
Signed-off-by: Eddy Petrisor <eddy.petrisor@gmail.com>
5 years ago
Eddy Petrisor d6d696b66a errorsn.rs: Separate hints from code, so hints are not accidentally seen
Signed-off-by: Eddy Petrisor <eddy.petrisor@gmail.com>
5 years ago
Eddy Petrisor ca6bf966dd Cargo fmt the rustlings application code
Signed-off-by: Eddy Petrisor <eddy.petrisor@gmail.com>
5 years ago
liv 5a9f8860ca
Add not passing integration test (#154)
Add not passing integration test
5 years ago
liv 5423bc66a9
Update errors1.rs - Add Result type signature as it is difficult for new comers to understand Generics and Error all at once. (#157)
Update errors1.rs - Add Result type signature as it is difficult for new comers to understand Generics and Error all at once.
5 years ago
Julien Bisconti 187d2ad226
Update errors1.rs
Add Result type signature as it is difficult for new comers to understand Generics and Error all at once
5 years ago
Denys Smirnov 7cf0d5d15e Add not passing integration test 5 years ago
liv 1f2ee8cb62 1.2.2 5 years ago
liv 35c3d0b3fc Revert --nocapture flag
This closes #149 and #152
5 years ago
liv 0279294972 1.2.1 5 years ago
liv 7eddee6f7a add a slightly more helpful error message 5 years ago
liv f2c48cfac5 fix the --nocapture functionality 5 years ago
liv 6ae0a00211 1.2.0 5 years ago
liv bfcf38c8bc
damn it 5 years ago
liv 9e328da641
use -- --nocapture when testing 5 years ago
bors e336d04c79 Auto merge of #144 - yvan-sraka:patch-0, r=komaeda
Add errors to exercises that compile without user changes

Hi !

I played a bit with rustlings, and I felt that some exercises were incorrect because they passed the tests without me needing to edit the files!

This gave me the feeling that the exercise was skiped! Especially when I use `rustlings watch`, it is easy to miss an exercise because the compilation error that is displayed is the one of the next exercise ...

It is easy to identify "broken" exercises with:

```bash
% find exercises -name "*.rs" | xargs -n 1 rustlings run
...
 Successfully ran exercises/move_semantics/move_semantics4.rs
 Successfully tested exercises/test2.rs
```

My suggestion is to make sure that these files trigger a compilation error by adding a simple syntax error (e.g. with `???` in the code that must change) so that our Rustacean can then play with it!
5 years ago
Yvan Sraka a71bc62c29
Add errors to exercises that compile without user changes 5 years ago
liv 4b0b7093e5 1.1.1 5 years ago
bors 8387de64d3 Auto merge of #143 - cjpearce:fix-exercise-path-matching, r=komaeda
Canonicalize paths to fix path matching

This PR should fix #126. The main solution to the issue was using `canonicalize()` on the paths we create for the exercises from `info.toml` and any user-specified paths, so that path `ends_with` matching will work correctly.

As adding calls to the canonicalize function everywhere requires unwrapping, I also decided to extract a struct representing an exercise and use serde to deserialize the paths from the `info.toml` file up front. I also tried to move the path handling out into the `exercise.rs` file and down into `main.rs` so that it doesn't create as much clutter. There was already a lot of unwrapping and path handling in the other files and I felt like it was getting a bit too repetitive.

If the approach is going too far (too many changes etc.) I'm happy to try to produce a smaller PR that fixes the bug without any refactoring.
6 years ago
Chris Pearce 77de6e5d6a Clean up test includes for File and Path 6 years ago
Chris Pearce 8c867a001a Remove unwrap on canonicalize result 6 years ago
Chris Pearce d01a71f7de Extract exercise struct to encapsulate path logic 6 years ago
bors 04d1d4c00e Auto merge of #142 - diodfr:patch-1, r=komaeda
Fix links by deleting book version
6 years ago
Diod FR d7e58ee1af
Fix links by deleting book version 6 years ago