data: consolidate the YAML embed convention into an embed_data! macro
This commit is contained in:
+3
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user