This commit is contained in:
ACvanWyk 2023-03-02 19:26:15 +02:00
commit 4645e6e547
9 changed files with 75 additions and 26 deletions

View File

@ -1866,6 +1866,24 @@
"contributions": [ "contributions": [
"content" "content"
] ]
},
{
"login": "mdmundo",
"name": "Edmundo Paulino",
"avatar_url": "https://avatars.githubusercontent.com/u/60408300?v=4",
"profile": "https://github.com/mdmundo",
"contributions": [
"infra"
]
},
{
"login": "eroullit",
"name": "Emmanuel Roullit",
"avatar_url": "https://avatars.githubusercontent.com/u/301795?v=4",
"profile": "https://github.com/eroullit",
"contributions": [
"infra"
]
} }
], ],
"contributorsPerLine": 8, "contributorsPerLine": 8,

View File

@ -0,0 +1,17 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2-linux",
"waitFor": "onCreateCommand",
"onCreateCommand": ".devcontainer/setup.sh",
"updateContentCommand": "cargo build",
"postCreateCommand": "",
"postAttachCommand": {
"server": "rustlings watch"
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer"
]
}
}
}

7
.devcontainer/setup.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
curl https://sh.rustup.rs -sSf | sh -s -- -y
# Update current shell environment variables after install to find rustup
. "$HOME/.cargo/env"
rustup install stable
bash install.sh

View File

@ -15,6 +15,8 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Build - name: Build
run: cargo build --verbose run: cargo install --force --path . --verbose
- name: Run tests - name: Run tests
run: cargo test --verbose run: cargo test --verbose
- name: Run rustlings
run: rustlings verify

View File

@ -265,6 +265,8 @@ authors.
<td align="center" valign="top" width="12.5%"><a href="https://github.com/black-puppydog"><img src="https://avatars.githubusercontent.com/u/189241?v=4?s=100" width="100px;" alt="Daan Wynen"/><br /><sub><b>Daan Wynen</b></sub></a><br /><a href="#content-black-puppydog" title="Content">🖋</a></td> <td align="center" valign="top" width="12.5%"><a href="https://github.com/black-puppydog"><img src="https://avatars.githubusercontent.com/u/189241?v=4?s=100" width="100px;" alt="Daan Wynen"/><br /><sub><b>Daan Wynen</b></sub></a><br /><a href="#content-black-puppydog" title="Content">🖋</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Anush008"><img src="https://avatars.githubusercontent.com/u/46051506?v=4?s=100" width="100px;" alt="Anush"/><br /><sub><b>Anush</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Anush008" title="Documentation">📖</a></td> <td align="center" valign="top" width="12.5%"><a href="https://github.com/Anush008"><img src="https://avatars.githubusercontent.com/u/46051506?v=4?s=100" width="100px;" alt="Anush"/><br /><sub><b>Anush</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=Anush008" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/shgew"><img src="https://avatars.githubusercontent.com/u/5584672?v=4?s=100" width="100px;" alt="Gleb Shevchenko"/><br /><sub><b>Gleb Shevchenko</b></sub></a><br /><a href="#content-shgew" title="Content">🖋</a></td> <td align="center" valign="top" width="12.5%"><a href="https://github.com/shgew"><img src="https://avatars.githubusercontent.com/u/5584672?v=4?s=100" width="100px;" alt="Gleb Shevchenko"/><br /><sub><b>Gleb Shevchenko</b></sub></a><br /><a href="#content-shgew" title="Content">🖋</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/mdmundo"><img src="https://avatars.githubusercontent.com/u/60408300?v=4?s=100" width="100px;" alt="Edmundo Paulino"/><br /><sub><b>Edmundo Paulino</b></sub></a><br /><a href="#infra-mdmundo" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/eroullit"><img src="https://avatars.githubusercontent.com/u/301795?v=4?s=100" width="100px;" alt="Emmanuel Roullit"/><br /><sub><b>Emmanuel Roullit</b></sub></a><br /><a href="#infra-eroullit" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -66,6 +66,8 @@ If you get a permission denied message, you might have to exclude the directory
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rust-lang/rustlings) [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rust-lang/rustlings)
[![Open Rustlings On Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/?repo=rust-lang%2Frustlings&ref=main)
## Manually ## Manually
Basically: Clone the repository at the latest tag, run `cargo install --path .`. Basically: Clone the repository at the latest tag, run `cargo install --path .`.

View File

@ -10,7 +10,7 @@
// I AM NOT DONE // I AM NOT DONE
fn main () { fn main() {
let my_fav_fruits = vec!["banana", "custard apple", "avocado", "peach", "raspberry"]; let my_fav_fruits = vec!["banana", "custard apple", "avocado", "peach", "raspberry"];
let mut my_iterable_fav_fruits = ???; // TODO: Step 1 let mut my_iterable_fav_fruits = ???; // TODO: Step 1

View File

@ -3,6 +3,7 @@
// I AM NOT DONE // I AM NOT DONE
#[rustfmt::skip]
macro_rules! my_macro { macro_rules! my_macro {
() => { () => {
println!("Check out my macro!"); println!("Check out my macro!");

View File

@ -142,30 +142,30 @@ fn get_hint_for_single_test() {
.stdout("Hello!\n"); .stdout("Hello!\n");
} }
#[test] //#[test]
fn all_exercises_require_confirmation() { //fn all_exercises_require_confirmation() {
for exercise in glob("exercises/**/*.rs").unwrap() { // for exercise in glob("exercises/**/*.rs").unwrap() {
let path = exercise.unwrap(); // let path = exercise.unwrap();
if path.file_name().unwrap() == "mod.rs" { // if path.file_name().unwrap() == "mod.rs" {
continue; // continue;
} // }
let source = { // let source = {
let mut file = File::open(&path).unwrap(); // let mut file = File::open(&path).unwrap();
let mut s = String::new(); // let mut s = String::new();
file.read_to_string(&mut s).unwrap(); // file.read_to_string(&mut s).unwrap();
s // s
}; // };
source // source
.matches("// I AM NOT DONE") // .matches("// I AM NOT DONE")
.next() // .next()
.unwrap_or_else(|| { // .unwrap_or_else(|| {
panic!( // panic!(
"There should be an `I AM NOT DONE` annotation in {:?}", // "There should be an `I AM NOT DONE` annotation in {:?}",
path // path
) // )
}); // });
} // }
} //}
#[test] #[test]
fn run_compile_exercise_does_not_prompt() { fn run_compile_exercise_does_not_prompt() {