injm 0.5.0

A CLI tool that injects content into marked regions in source files.
use serde::Serialize;
use tabled::{Table, Tabled};

use crate::cli::OutputFormat;
use crate::core::types::Result;

pub fn print<T>(rows: &[T], format: OutputFormat) -> Result<()>
where
    T: Serialize + Tabled,
{
    match format {
        OutputFormat::Table => {
            println!("{}", Table::new(rows));
        }
        OutputFormat::Json => {
            println!("{}", serde_json::to_string_pretty(rows)?);
        }
    }

    Ok(())
}