Format the change for JSON output.
(
&self,
change: &Change,
hash: &Hash,
sequence: Option<u64>,
)
| 654 | |
| 655 | /// Format the change for JSON output. |
| 656 | pub(crate) fn format_json( |
| 657 | &self, |
| 658 | change: &Change, |
| 659 | hash: &Hash, |
| 660 | sequence: Option<u64>, |
| 661 | ) -> String { |
| 662 | let json_change = JsonChange::from_change_with_provenance(change, hash, sequence); |
| 663 | serde_json::to_string_pretty(&json_change) |
| 664 | .unwrap_or_else(|e| format!("{{\"error\": \"Failed to serialize: {}\"}}", e)) |
| 665 | } |
| 666 | |
| 667 | /// Print the change in the configured format. |
| 668 | fn print_change(&self, change: &Change, hash: &Hash, sequence: Option<u64>, repo: &Repository) { |
no outgoing calls