askr 0.1.7

Interactive CLI input tool with real-time validation and choice menus
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use super::OutputFormatter;
use crate::error::Result;
use crate::validation::ValidationSummary;

/// JSON output formatter
pub struct JsonFormatter;

impl OutputFormatter for JsonFormatter {
    fn format(&self, summary: &ValidationSummary) -> Result<String> {
        let json = serde_json::to_string_pretty(summary)?;
        Ok(json)
    }
}