From 2cf54dcf2e76712f44cff58fbf85ece9b6ce576f Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 28 Feb 2023 14:52:59 +0100 Subject: [PATCH] router: make format&print generic Signed-off-by: Wolfgang Bumiller --- proxmox-router/src/cli/format.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxmox-router/src/cli/format.rs b/proxmox-router/src/cli/format.rs index 1d562868..65743597 100644 --- a/proxmox-router/src/cli/format.rs +++ b/proxmox-router/src/cli/format.rs @@ -2,6 +2,7 @@ use std::collections::HashSet; +use serde::Serialize; use serde_json::Value; use proxmox_schema::format::{ @@ -17,7 +18,7 @@ use super::{CliCommand, CliCommandMap, CommandLineInterface}; /// This is implemented for machine generatable formats 'json' and /// 'json-pretty'. The 'text' format needs to be handled somewhere /// else. -pub fn format_and_print_result(result: &Value, output_format: &str) { +pub fn format_and_print_result(result: &T, output_format: &str) { if output_format == "json-pretty" { println!("{}", serde_json::to_string_pretty(&result).unwrap()); } else if output_format == "json" {