Skip to main content

open_envault/
output.rs

1use serde::Serialize;
2
3pub fn redact(value: &str) -> String {
4    if value.is_empty() {
5        "<empty>".into()
6    } else {
7        "<redacted>".into()
8    }
9}
10
11#[derive(Debug, Serialize)]
12pub struct Finding {
13    pub variable: String,
14    pub kind: String,
15    pub message: String,
16}
17
18pub fn json<T: Serialize>(value: &T) -> anyhow::Result<String> {
19    Ok(serde_json::to_string_pretty(value)?)
20}