MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / parse_changelist

Function parse_changelist

atomic-remote/src/http/mod.rs:292–309  ·  view source on GitHub ↗

Parse a changelist response into entries.

(text: &str)

Source from the content-addressed store, hash-verified

290
291/// Parse a changelist response into entries.
292pub(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}

Calls 3

linesMethod · 0.45
is_emptyMethod · 0.45
pushMethod · 0.45