From 5b860864cd6636b91e8ef9466ff7b5054d3e5dee Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Sun, 3 May 2026 14:41:56 +0200 Subject: [PATCH] Add readme to generated rustlings directory This can remind users how to use rustlings, in case they come back after a lengthy break. --- src/init.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/init.rs b/src/init.rs index f043bd48..2e61f8fa 100644 --- a/src/init.rs +++ b/src/init.rs @@ -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: + +"; + 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.