mirror of https://github.com/rust-lang/rustlings
Merge branch 'main' into main
commit
76acf613c5
@ -1,17 +1,8 @@
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
"image": "mcr.microsoft.com/devcontainers/rust:1",
|
||||
"updateContentCommand": ["cargo", "build"],
|
||||
"postAttachCommand": ["rustlings", "watch"],
|
||||
"remoteEnv": {
|
||||
"PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/target/debug"
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
#!/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
|
@ -0,0 +1,2 @@
|
||||
* text=auto
|
||||
*.sh text eol=lf
|
@ -1,33 +1,28 @@
|
||||
macro_rules! warn {
|
||||
($fmt:literal, $ex:expr) => {{
|
||||
macro_rules! print_emoji {
|
||||
($emoji:expr, $sign:expr, $color: ident ,$fmt:literal, $ex:expr) => {{
|
||||
use console::{style, Emoji};
|
||||
use std::env;
|
||||
let formatstr = format!($fmt, $ex);
|
||||
if env::var("NO_EMOJI").is_ok() {
|
||||
println!("{} {}", style("!").red(), style(formatstr).red());
|
||||
println!("{} {}", style($sign).$color(), style(formatstr).$color());
|
||||
} else {
|
||||
println!(
|
||||
"{} {}",
|
||||
style(Emoji("⚠️ ", "!")).red(),
|
||||
style(formatstr).red()
|
||||
style(Emoji($emoji, $sign)).$color(),
|
||||
style(formatstr).$color()
|
||||
);
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
macro_rules! warn {
|
||||
($fmt:literal, $ex:expr) => {{
|
||||
print_emoji!("⚠️ ", "!", red, $fmt, $ex);
|
||||
}};
|
||||
}
|
||||
|
||||
macro_rules! success {
|
||||
($fmt:literal, $ex:expr) => {{
|
||||
use console::{style, Emoji};
|
||||
use std::env;
|
||||
let formatstr = format!($fmt, $ex);
|
||||
if env::var("NO_EMOJI").is_ok() {
|
||||
println!("{} {}", style("✓").green(), style(formatstr).green());
|
||||
} else {
|
||||
println!(
|
||||
"{} {}",
|
||||
style(Emoji("✅", "✓")).green(),
|
||||
style(formatstr).green()
|
||||
);
|
||||
}
|
||||
print_emoji!("✅ ", "✓", green, $fmt, $ex);
|
||||
}};
|
||||
}
|
||||
|
Loading…
Reference in New Issue