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

Method summary

atomic-agent/src/event.rs:580–602  ·  view source on GitHub ↗

Returns a summary string suitable for log messages. # Example output ```text "3 files changed (1 modified, 1 added, 1 deleted)" ```

(&self)

Source from the content-addressed store, hash-verified

578 /// "3 files changed (1 modified, 1 added, 1 deleted)"
579 /// ```
580 pub fn summary(&self) -> String {
581 if self.is_empty() {
582 return "no files changed".to_string();
583 }
584
585 let mut parts = Vec::new();
586 if !self.modified.is_empty() {
587 parts.push(format!("{} modified", self.modified.len()));
588 }
589 if !self.added.is_empty() {
590 parts.push(format!("{} added", self.added.len()));
591 }
592 if !self.deleted.is_empty() {
593 parts.push(format!("{} deleted", self.deleted.len()));
594 }
595
596 format!(
597 "{} file{} changed ({})",
598 self.file_count(),
599 if self.file_count() == 1 { "" } else { "s" },
600 parts.join(", "),
601 )
602 }
603}
604
605impl fmt::Display for TurnChanges {

Callers 1

statusMethod · 0.45

Calls 2

is_emptyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected