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": [
"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,

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:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
run: cargo install --force --path . --verbose
- name: Run tests
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/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/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>
</tbody>
</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 Rustlings On Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/?repo=rust-lang%2Frustlings&ref=main)
## Manually
Basically: Clone the repository at the latest tag, run `cargo install --path .`.

View File

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

View File

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

View File

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