Remove default run

This commit is contained in:
Jack Clayton 2022-01-13 20:15:06 +08:00
parent 27c1be0e4e
commit aba47a5c96
2 changed files with 9 additions and 10 deletions

View File

@ -3,7 +3,6 @@ name = "rustlings"
version = "4.6.0"
authors = ["anastasie <ana@ana.st>", "Carol (Nichols || Goulding) <carol.nichols@gmail.com>"]
edition = "2021"
default-run = "rustlings"
[dependencies]
argh = "0.1.4"

View File

@ -32,6 +32,15 @@ impl RustAnalyzerProject {
}
}
/// Write rust-project.json to disk
pub fn write_to_disk(&self) -> Result<(), std::io::Error> {
std::fs::write(
"./rust-project.json",
serde_json::to_vec(&self).expect("Failed to serialize to JSON"),
)?;
Ok(())
}
/// If path contains .rs extension, add a crate to `rust-project.json`
fn path_to_json(&mut self, path: String) {
if let Some((_, ext)) = path.split_once(".") {
@ -45,15 +54,6 @@ impl RustAnalyzerProject {
}
}
/// Write rust-project.json to disk
pub fn write_to_disk(&self) -> Result<(), std::io::Error> {
std::fs::write(
"./rust-project.json",
serde_json::to_vec(&self).expect("Failed to serialize to JSON"),
)?;
Ok(())
}
/// Parse the exercises folder for .rs files, any matches will create
/// a new `crate` in rust-project.json which allows rust-analyzer to
/// treat it like a normal binary