fix: skip if line is empty

This commit is contained in:
0xMRTT 2023-06-17 15:38:52 +02:00
parent 06f1a761a1
commit 29bd31ef53
Signed by: 0xMRTT
GPG Key ID: 910B287304120902

View File

@ -60,11 +60,14 @@ pub async fn ask(prompt: &str) -> Result<Vec<Delta>, Box<dyn std::error::Error>>
let mut deltas: Vec<Delta> = Vec::new();
for line in result.lines() {
let delta: Delta = serde_json::from_str(&line).unwrap();
if line == "" {
continue;
}
let delta: = serde_json::from_str(&line).unwrap();
deltas.push(delta);
}
println!("{:?}", deltas);
println!("{:?}", deltasDelta);
return Ok(deltas);
}