aboutsummaryrefslogtreecommitdiff
path: root/mingling_ci/src/cmd/cmd_show_features.rs
blob: 5fff0c50f5bbfef4c7e56f9283e495d7aa9e8ce9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use mingling::{
    Grouped,
    macros::{buffer, command, r_println, renderer},
};

use crate::res::ResFeatureList;

#[command(node = "show-features")]
pub fn show_features(features: &ResFeatureList) -> ResultShowFeatures {
    ResultShowFeatures {
        features: features.list.clone(),
    }
}

/// The docs.rs feature list of `mingling`.
#[derive(Grouped)]
pub struct ResultShowFeatures {
    pub features: Vec<String>,
}

#[renderer(buffer)]
pub fn render_show_features(r: ResultShowFeatures) {
    for feature in r.features {
        r_println!("{feature}");
    }
}