Merge 5b860864cd6636b91e8ef9466ff7b5054d3e5dee into 5e7a5d172106e75a50039a1846e38eca9f812bc1

This commit is contained in:
Remo Senekowitsch 2026-06-24 18:18:20 +00:00 committed by GitHub
commit f1343ffac9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -165,6 +165,8 @@ pub fn init() -> Result<()> {
fs::write(".gitignore", GITIGNORE)
.context("Failed to create the file `rustlings/.gitignore`")?;
fs::write("README.md", README).context("Failed to create the file `rustlings/README.md`")?;
create_dir(".vscode").context("Failed to create the directory `rustlings/.vscode`")?;
fs::write(".vscode/extensions.json", VS_CODE_EXTENSIONS_JSON)
.context("Failed to create the file `rustlings/.vscode/extensions.json`")?;
@ -220,6 +222,14 @@ target/
.vscode/
";
const README: &[u8] = b"# Rustlings
This is your space to solve Rustlings exercises.
Simply run `rustlings` in this directory to get started!
Learn more about using Rustlings here:
<https://rustlings.rust-lang.org/usage/>
";
pub const VS_CODE_EXTENSIONS_JSON: &[u8] = br#"{"recommendations":["rust-lang.rust-analyzer"]}"#;
const IN_INITIALIZED_DIR_ERR: &str = "It looks like Rustlings is already initialized in this directory.