fix: skip if line is empty
This commit is contained in:
parent
06f1a761a1
commit
29bd31ef53
@ -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();
|
let mut deltas: Vec<Delta> = Vec::new();
|
||||||
for line in result.lines() {
|
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);
|
deltas.push(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("{:?}", deltas);
|
println!("{:?}", deltasDelta);
|
||||||
|
|
||||||
return Ok(deltas);
|
return Ok(deltas);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user