data: consolidate the YAML embed convention into an embed_data! macro

This commit is contained in:
2026-09-18 13:22:13 +02:00
parent 6e5ecd2f45
commit ead97e1213
5 changed files with 84 additions and 20 deletions
+3 -4
View File
@@ -3,7 +3,7 @@
//! This module provides functionality to read quirks from a YAML file
//! and apply them during pull and deb operations.
use lazy_static::lazy_static;
use crate::data::embed_data;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
@@ -44,9 +44,8 @@ pub struct QuirksConfig {
pub quirks: HashMap<String, PackageQuirks>,
}
const QUIRKS_YAML: &str = include_str!("../data/quirks.yml");
lazy_static! {
static ref QUIRKS_DATA: QuirksConfig = serde_yaml::from_str(QUIRKS_YAML).unwrap();
embed_data! {
static ref QUIRKS_DATA: QuirksConfig = "../data/quirks.yml"
}
/// Get quirks for a specific package