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

Function parse_trailer

atomic-cli/src/commands/git/verify_receive.rs:306–318  ·  view source on GitHub ↗
(message: &str, key: &str)

Source from the content-addressed store, hash-verified

304}
305
306fn parse_trailer(message: &str, key: &str) -> Option<String> {
307 let prefix = format!("{key}:");
308 for line in message.lines() {
309 let line = line.trim();
310 if let Some(rest) = line.strip_prefix(&prefix) {
311 let value = rest.trim();
312 if !value.is_empty() {
313 return Some(value.to_string());
314 }
315 }
316 }
317 None
318}
319
320#[cfg(test)]
321mod tests {

Callers 1

resolve_projection_stateFunction · 0.70

Calls 2

linesMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected