| 1 | use super::{RunEvent, truncate}; |
| 2 | |
| 3 | const STEP_LIMIT: usize = 80; |
| 4 | |
| 5 | pub(super) fn parse_line(line: &str, all_output: &mut String) -> Vec<RunEvent> { |
| 6 | all_output.push_str(line); |
| 7 | all_output.push('\n'); |
| 8 | let trimmed = line.trim(); |
| 9 | if trimmed.is_empty() { |
| 10 | return Vec::new(); |
| 11 | } |
| 12 | vec![RunEvent::Step(truncate(trimmed, STEP_LIMIT))] |
| 13 | } |
| 14 | |
| 15 | pub(super) fn finish(all_output: &str) -> Vec<RunEvent> { |
| 16 | vec![RunEvent::Final(all_output.trim().to_string())] |
| 17 | } |