Parse a changelist response into entries.
(text: &str)
| 290 | |
| 291 | /// Parse a changelist response into entries. |
| 292 | pub(crate) fn parse_changelist(text: &str) -> RemoteResult<Vec<ChangelistEntry>> { |
| 293 | let mut entries = Vec::new(); |
| 294 | |
| 295 | for line in text.lines() { |
| 296 | let line = line.trim(); |
| 297 | if line.is_empty() { |
| 298 | continue; |
| 299 | } |
| 300 | |
| 301 | let entry = ChangelistEntry::parse(line).map_err(|e| { |
| 302 | RemoteError::protocol(format!("Failed to parse changelist entry: {}", e)) |
| 303 | })?; |
| 304 | |
| 305 | entries.push(entry); |
| 306 | } |
| 307 | |
| 308 | Ok(entries) |
| 309 | } |