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

Method summary

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

961 /// "3 files changed (1 modified, 1 added, 1 deleted)"
962 /// ```
963 pub fn summary(&self) -> String {
964 if self.is_empty() {
965 return "no files changed".to_string();
966 }
967
968 let mut parts = Vec::new();
969 if !self.modified.is_empty() {
970 parts.push(format!("{} modified", self.modified.len()));
971 }
972 if !self.added.is_empty() {
973 parts.push(format!("{} added", self.added.len()));
974 }
975 if !self.deleted.is_empty() {
976 parts.push(format!("{} deleted", self.deleted.len()));
977 }
978
979 format!(
980 "{} file{} changed ({})",
981 self.file_count(),
982 if self.file_count() == 1 { "" } else { "s" },
983 parts.join(", "),
984 )
985 }
986}
987
988impl fmt::Display for TurnChanges {

Callers 1

summarizeFunction · 0.45

Calls 2

is_emptyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected