summaryrefslogtreecommitdiff
path: root/src/dev/init.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-04-17 15:55:50 +0200
committermo8it <mo8it@proton.me>2024-04-17 15:55:50 +0200
commit501b973c258a3c2e3a463d58c16402302184380f (patch)
treea03812f5d3f5a5ef9e171077fb6aa6571a3f31fb /src/dev/init.rs
parent30636e7cf345757f95235744ff81376ae81c9aa2 (diff)
Add "dev update"
Diffstat (limited to 'src/dev/init.rs')
-rw-r--r--src/dev/init.rs23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/dev/init.rs b/src/dev/init.rs
index 0993522..3ce5055 100644
--- a/src/dev/init.rs
+++ b/src/dev/init.rs
@@ -1,6 +1,5 @@
-use std::fs::{self, create_dir};
-
use anyhow::{Context, Result};
+use std::fs::{self, create_dir};
use crate::CURRENT_FORMAT_VERSION;
@@ -19,11 +18,8 @@ pub fn init() -> Result<()> {
)
.context("Failed to create the file `rustlings/info.toml`")?;
- fs::write(
- "rustlings/Cargo.toml",
- format!("{CARGO_TOML_COMMENT}{}", crate::init::CARGO_TOML_PACKAGE),
- )
- .context("Failed to create the file `rustlings/Cargo.toml`")?;
+ fs::write("rustlings/Cargo.toml", CARGO_TOML)
+ .context("Failed to create the file `rustlings/Cargo.toml`")?;
fs::write("rustlings/.gitignore", crate::init::GITIGNORE)
.context("Failed to create the file `rustlings/.gitignore`")?;
@@ -80,10 +76,17 @@ mode = "test"
hint = """???"""
"#;
-const CARGO_TOML_COMMENT: &str =
- "# You shouldn't edit this file manually! It is updated by `rustlings dev check`
+const CARGO_TOML: &[u8] =
+ br#"# Don't edit the `bin` list manually! It is updated by `rustlings dev update`
+bin = []
-";
+[package]
+name = "rustlings"
+edition = "2021"
+publish = false
+
+[dependencies]
+"#;
const README: &str = "# Rustlings 🦀