Good stuff

This commit is contained in:
Andras Schmelczer 2026-02-22 22:36:40 +00:00
parent 9da2db707f
commit 8032011708
32 changed files with 1052 additions and 374 deletions

View file

@ -16,6 +16,10 @@ fn is_false(val: &bool) -> bool {
!val
}
fn is_empty_slice(val: &&[&str]) -> bool {
val.is_empty()
}
#[derive(Clone, Serialize)]
#[serde(tag = "type")]
pub enum FeatureInfo {
@ -37,6 +41,10 @@ pub enum FeatureInfo {
raw: bool,
#[serde(skip_serializing_if = "is_false")]
absolute: bool,
#[serde(skip_serializing_if = "is_empty_slice")]
modes: &'static [&'static str],
#[serde(skip_serializing_if = "is_empty")]
linked: &'static str,
},
#[serde(rename = "enum")]
Enum {
@ -102,6 +110,8 @@ pub fn build_features_response(data: &PropertyData) -> FeaturesResponse {
suffix: feature_config.suffix,
raw: feature_config.raw,
absolute: feature_config.absolute,
modes: feature_config.modes,
linked: feature_config.linked,
});
}
}