mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 05:52:23 -05:00
Remove unneeded check if crates is empty
This commit is contained in:
parent
87e55ccffd
commit
f5135ae4df
2 changed files with 2 additions and 4 deletions
|
@ -209,9 +209,7 @@ fn main() -> Result<()> {
|
||||||
.exercises_to_json(exercises)
|
.exercises_to_json(exercises)
|
||||||
.expect("Couldn't parse rustlings exercises files");
|
.expect("Couldn't parse rustlings exercises files");
|
||||||
|
|
||||||
if project.crates.is_empty() {
|
if project.write_to_disk().is_err() {
|
||||||
println!("Failed find any exercises, make sure you're in the `rustlings` folder");
|
|
||||||
} else if project.write_to_disk().is_err() {
|
|
||||||
println!("Failed to write rust-project.json to disk for rust-analyzer");
|
println!("Failed to write rust-project.json to disk for rust-analyzer");
|
||||||
} else {
|
} else {
|
||||||
println!("Successfully generated rust-project.json");
|
println!("Successfully generated rust-project.json");
|
||||||
|
|
|
@ -12,7 +12,7 @@ use crate::exercise::Exercise;
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct RustAnalyzerProject {
|
pub struct RustAnalyzerProject {
|
||||||
sysroot_src: String,
|
sysroot_src: String,
|
||||||
pub crates: Vec<Crate>,
|
crates: Vec<Crate>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
|
Loading…
Reference in a new issue