src/bin/proxmox-backup-manager.rs: improve user list output

This commit is contained in:
Dietmar Maurer
2020-05-01 16:08:15 +02:00
parent 32d83bb34c
commit b080583ba8
2 changed files with 13 additions and 2 deletions

View File

@ -41,3 +41,8 @@ pub fn render_task_status(value: &Value, record: &Value) -> Result<String, Error
Ok(value.as_str().unwrap_or("unknown").to_string())
}
}
pub fn render_bool_with_default_true(value: &Value, _record: &Value) -> Result<String, Error> {
let value = value.as_bool().unwrap_or(true);
Ok((if value { "1" } else { "0" }).to_string())
}