Remove unneeded check if crates is empty

This commit is contained in:
mo8it 2024-03-25 22:29:33 +01:00
parent 87e55ccffd
commit f5135ae4df
2 changed files with 2 additions and 4 deletions

View file

@ -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");

View file

@ -12,7 +12,7 @@ use crate::exercise::Exercise;
#[derive(Serialize, Deserialize)]
pub struct RustAnalyzerProject {
sysroot_src: String,
pub crates: Vec<Crate>,
crates: Vec<Crate>,
}
#[derive(Serialize, Deserialize)]