mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-10 12:49:18 +00:00
Remove default run
This commit is contained in:
parent
27c1be0e4e
commit
aba47a5c96
@ -3,7 +3,6 @@ name = "rustlings"
|
|||||||
version = "4.6.0"
|
version = "4.6.0"
|
||||||
authors = ["anastasie <ana@ana.st>", "Carol (Nichols || Goulding) <carol.nichols@gmail.com>"]
|
authors = ["anastasie <ana@ana.st>", "Carol (Nichols || Goulding) <carol.nichols@gmail.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
default-run = "rustlings"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
argh = "0.1.4"
|
argh = "0.1.4"
|
||||||
|
|||||||
@ -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`
|
/// If path contains .rs extension, add a crate to `rust-project.json`
|
||||||
fn path_to_json(&mut self, path: String) {
|
fn path_to_json(&mut self, path: String) {
|
||||||
if let Some((_, ext)) = path.split_once(".") {
|
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
|
/// Parse the exercises folder for .rs files, any matches will create
|
||||||
/// a new `crate` in rust-project.json which allows rust-analyzer to
|
/// a new `crate` in rust-project.json which allows rust-analyzer to
|
||||||
/// treat it like a normal binary
|
/// treat it like a normal binary
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user