Skip to main content

shakrs_json_parser/runtime/
config.rs

1//! Runtime defaults for config document types.
2
3use std::collections::BTreeMap;
4
5use crate::types::{PoliciesSection, ShakrsConfig};
6
7/// Serde default for [`PoliciesSection::default_enabled`].
8pub const fn default_true() -> bool {
9    true
10}
11
12impl Default for ShakrsConfig {
13    fn default() -> Self {
14        Self {
15            version: 1,
16            policies: PoliciesSection::default(),
17            waivers: Vec::new(),
18        }
19    }
20}
21
22impl Default for PoliciesSection {
23    fn default() -> Self {
24        Self {
25            default_enabled: true,
26            overrides: BTreeMap::new(),
27        }
28    }
29}