From f5135ae4df96ee018896d667f3dffa187c959193 Mon Sep 17 00:00:00 2001 From: mo8it Date: Mon, 25 Mar 2024 22:29:33 +0100 Subject: [PATCH] Remove unneeded check if crates is empty --- src/main.rs | 4 +--- src/project.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 803e2f8..1f260ab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -209,9 +209,7 @@ fn main() -> Result<()> { .exercises_to_json(exercises) .expect("Couldn't parse rustlings exercises files"); - if project.crates.is_empty() { - println!("Failed find any exercises, make sure you're in the `rustlings` folder"); - } else if project.write_to_disk().is_err() { + if project.write_to_disk().is_err() { println!("Failed to write rust-project.json to disk for rust-analyzer"); } else { println!("Successfully generated rust-project.json"); diff --git a/src/project.rs b/src/project.rs index 534aab0..835a951 100644 --- a/src/project.rs +++ b/src/project.rs @@ -12,7 +12,7 @@ use crate::exercise::Exercise; #[derive(Serialize, Deserialize)] pub struct RustAnalyzerProject { sysroot_src: String, - pub crates: Vec, + crates: Vec, } #[derive(Serialize, Deserialize)]