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

Method summary

atomic-agent/src/event.rs:572–594  ·  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

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

Callers

nothing calls this directly

Calls 2

is_emptyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected