tokmd-format 1.13.0

Output formatting and serialization (Markdown, JSON, CSV) for tokmd.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Tree rendering for analysis receipts.
//!
//! This module owns the `AnalysisFormat::Tree` projection and preserves the
//! existing fallback when no derived tree is present.

use tokmd_analysis_types::AnalysisReceipt;

pub(super) fn render(receipt: &AnalysisReceipt) -> String {
    receipt
        .derived
        .as_ref()
        .and_then(|d| d.tree.clone())
        .unwrap_or_else(|| "(tree unavailable)".to_string())
}