Commit Graph

339 Commits (c5bb32253b145b96c2f3049c2f0644f13d921290)
 

Author SHA1 Message Date
bors c5bb32253b Auto merge of #209 - Dylnuge:slice-assert, r=komaeda
fix(primitive_types4): Fail on a slice covering the wrong area

I noticed this issue and it seems like a similar one was raised/fixed in #160 this way. This is my first contribution to this repo (or any Rust project) so let me know if I messed up or need to fix anything!

---
This commit converts primitive_types4 to a test and asserts that the
slice given is equal to the expected slice.

The intent of the primitive_types4 exercise appears to be to ensure the
user understands inclusive and exclusive bounds as well as slice syntax.
`rustlings` commands using `compile` do not verify that a specific
println is reached and, in the case of `watch` and `verify` (but not
`run`), they do not output the `println`s at all.

This fix is semantically similar to #198. It does not take a stance on
the correct way to handle this for all exercises; see #127. There are
likely other exercises whose intent are masked by this issue.
5 years ago
Dylan Nugent 5b1e673cec fix(primitive_types4): Fail on a slice covering the wrong area
This commit converts primitive_types4 to a test and asserts that the
slice given is equal to the expected slice.

The intent of the primitive_types4 exercise appears to be to ensure the
user understands inclusive and exclusive bounds as well as slice syntax.
`rustlings` commands using `compile` do not verify that a specific
println is reached and, in the case of `watch` and `verify` (but not
`run`), they do not output the `println`s at all.

This fix is semantically similar to #198. It does not take a stance on
the correct way to handle this for all exercises; see #127. There are
likely other exercises whose intent are masked by this issue.
5 years ago
bors 2cd06826c0 Auto merge of #206 - ajaxm:ajaxm/rustup-update, r=komaeda
Suggest rustup update in readme

I'm pretty new to Rust. I tried installing rustlings for the first time and got this error:
```
$> cargo install --force --path .
error: `/Users/ajax/projects/rust/rustlings` is not a crate root; specify a crate to install from crates.io, or use --path or --git to specify an alternate source

Caused by:
  failed to parse manifest at `/Users/ajax/projects/rust/rustlings/Cargo.toml`

Caused by:
  editions are unstable

Caused by:
  feature `edition` is required

this Cargo does not support nightly features, but if you
switch to nightly channel you can add
`cargo-features = ["edition"]` to enable this feature
```

I'm not sure if the answer was to run `rustup update` but I noticed that I was running Rust 1.29.0, so updated to 1.36.0 and got it working. If there's a way to specify a minimum required version, pls let me know.

Lastly, the whitespace changes were automatic from my editor. What's the convention here for making such updates? Thanks!
5 years ago
marisa 4f0c5a8d49
1.4.1 5 years ago
bors 3011251da7 Auto merge of #208 - EnricoMiccoli:patch-1, r=komaeda
chore: Correct typo in hint text
5 years ago
Enrico Miccoli 76b4cb5c00
chore: Correct typo 5 years ago
bors f83af3c25d Auto merge of #207 - nkanderson:fix_iterators2, r=komaeda
Fix iterators2

A couple of small changes to the `iterators2` exercise. @Jesse-Cameron, it looks like you contributed this exercise, so I wanted to check and see if these changes are in line with your intentions. Happy to adjust if they're not :)
5 years ago
Niklas Anderson e3931718fb chore(iterators2): Add exercise instructions 5 years ago
Niklas Anderson 4cde86643e fix(iterators2): Remove syntax resulting in misleading error message
closes #199
5 years ago
Ajax Manohar 9ee3207280 docs: Suggest rustup update in readme 5 years ago
bors e696a07190 Auto merge of #201 - zdzc:patch-1, r=komaeda
docs: Fix wrong title

fix #200
5 years ago
Andre Pratama e0db987441
docs: Fix wrong title
fix #200
5 years ago
bors 1890b0019d Auto merge of #198 - nkanderson:160_options1-add-test, r=komaeda
fix(option1): Add test for prematurely passing exercise

Fixes the bug referenced in #160, but does not address the larger feature work referenced by the issue.
5 years ago
Niklas Anderson a750e4a1a3 fix(option1): Add test for prematurely passing exercise
Fixes the bug referenced in #160, but does not address the larger feature work referenced by the issue.
5 years ago
bors 1c789dda08 Auto merge of #192 - petemcfarlane:patch-2, r=komaeda
fix(test1): Swap assertion parameter order

`Expected` should come before `actual`, other wise it leads to confusing compiler messages, e.g.
```
note: expected type `()`
         found type `{integer}`
```
There may be other tests that need updating, but this is as far as I am through the Rustlings course right now :)
5 years ago
Pete McFarlane 4086d463a9
fix(test1): Swap assertion parameter order
`Expected` should come before `actual`, other wise it leads to confusing compiler messages, e.g.
```
note: expected type `()`
         found type `{integer}`
```
5 years ago
marisa b8368de6d5
1.4.0 5 years ago
bors 7dc90094d2 Auto merge of #191 - MrFroop:master, r=komaeda
Fix(watch): Check if changed exercise file exists before calling verify.

Prevent a panic if the file triggering the watch event is gone.
5 years ago
Fredrik Jambrén ba85ca32c4 Check if changed exercise file exists before calling verify. 5 years ago
etisdew 70946b85e5 fix(readme): http to https
changing readme image (line 1) to https fixes markdown preview and improves fidelity
5 years ago
bors 1570c328c6 Auto merge of #186 - Jesse-Cameron:iterator-exercise2, r=komaeda
feat(iterators2): adds iterators2 exercise including config

Hi there!

I really enjoyed doing the rustlings exercises so I thought that I would try to add an exercise!

This one just covers a couple of basic iterator operations. Getting people used to the `map` and `collect` functions.

However, it does feel kinda similar to the next exercise. So I may also revisit some of the tests in iterators3 if we think that is necessary.
5 years ago
Jesse 9288fccf07 feat(iterators2): adds iterators2 exercise including config 5 years ago
bors 5e1d7c3076 Auto merge of #184 - Jesse-Cameron:master, r=komaeda
fix(test1): renamed function name to snake case

addressing a minor function naming convention, see: [RFC #430](https://doc.rust-lang.org/1.0.0/style/style/naming/README.html)

closes #180
5 years ago
Jesse 89d5186c0d fix(test1): renamed function name to snake case
closes #180
5 years ago
bors aaad60d07e Auto merge of #172 - miller-time:fix-book-links, r=komaeda
chore: Fix a couple broken book links

While I was fixing these, I figured maybe it's good to just use a consistent URL for book links: https://doc.rust-lang.org/book/

Is there a plan for what to do with this old 1.4.0 example that doesn't exist in the current version of the book? Perhaps at least include a disclaimer when recommending that folks check it out?

34e31232df/exercises/threads/README.md (L1)
5 years ago
bors 5f16469807 Auto merge of #171 - miller-time:rustfmt-exercises, r=komaeda
chore: Clean up some formatting in exercises

I noticed some formatting that isn't consistent with the `rustfmt` style and tried my best to run it on the files in the exercises directory (which does fail for files that can't compile!), which just caught some minor whitespace things here and there.

Note: also can't just apply `rustfmt` blindly because of the blank lines that lead to the hint comments
5 years ago
bors 752bc27e2b Auto merge of #179 - briankung:fix_irrefutable_let_pattern_structs1, r=komaeda
Fixes the irrefutable let pattern warning in `structs1.rs`

PR https://github.com/rust-lang/rustlings/pull/163 accidentally introduced an error using some versions of the Rust compiler where the compiler would (rightly!) complain about an irrefutable let pattern. I have no idea why this did not occur in all versions of the compiler, but here is a way around it.
5 years ago
Brian Kung cc6a14104d Fixes the irrefutable let pattern warning 5 years ago
Russell Cousineau eb13c2b6af chore: Clean up some formatting in exercises 5 years ago
Russell Cousineau 63c133e4a3 chore: Fix a couple broken book links 5 years ago
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