tealr_doc_gen 0.2.0

A cli tool to create online documentation for apis made with tealr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::borrow::Cow;

use tealr::TypeGenerator;

pub(crate) fn get_type_name(type_def: &TypeGenerator) -> Cow<'static, str> {
    let z = match type_def {
        TypeGenerator::Record(x) => &x.type_name,
        TypeGenerator::Enum(x) => &x.name,
    };
    tealr::type_parts_to_str(z.clone())
}

pub(crate) fn type_should_be_inlined(v: &TypeGenerator) -> bool {
    match v {
        TypeGenerator::Record(x) => x.should_be_inlined,
        TypeGenerator::Enum(_) => false,
    }
}