mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-05-15 17:58:44 +00:00
Add readme to generated rustlings directory
This can remind users how to use rustlings, in case they come back after a lengthy break.
This commit is contained in:
parent
4f1a440962
commit
5b860864cd
10
src/init.rs
10
src/init.rs
@ -165,6 +165,8 @@ pub fn init() -> Result<()> {
|
|||||||
fs::write(".gitignore", GITIGNORE)
|
fs::write(".gitignore", GITIGNORE)
|
||||||
.context("Failed to create the file `rustlings/.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`")?;
|
create_dir(".vscode").context("Failed to create the directory `rustlings/.vscode`")?;
|
||||||
fs::write(".vscode/extensions.json", VS_CODE_EXTENSIONS_JSON)
|
fs::write(".vscode/extensions.json", VS_CODE_EXTENSIONS_JSON)
|
||||||
.context("Failed to create the file `rustlings/.vscode/extensions.json`")?;
|
.context("Failed to create the file `rustlings/.vscode/extensions.json`")?;
|
||||||
@ -220,6 +222,14 @@ target/
|
|||||||
.vscode/
|
.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"]}"#;
|
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.
|
const IN_INITIALIZED_DIR_ERR: &str = "It looks like Rustlings is already initialized in this directory.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user