From 563f7dfc2a1c57dc94c722e87373a81be9d65edd Mon Sep 17 00:00:00 2001 From: Wilson Lin Date: Tue, 10 Aug 2021 14:23:33 +1000 Subject: [PATCH] Implement Default and spec_compliant for Cfg --- rust/main/src/cfg/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rust/main/src/cfg/mod.rs b/rust/main/src/cfg/mod.rs index 272434a..adffe93 100644 --- a/rust/main/src/cfg/mod.rs +++ b/rust/main/src/cfg/mod.rs @@ -43,4 +43,18 @@ impl Cfg { remove_processing_instructions: false, } } + + pub fn spec_compliant() -> Cfg { + Cfg { + ensure_spec_compliant_unquoted_attribute_values: true, + keep_spaces_between_attributes: true, + ..Cfg::new() + } + } +} + +impl Default for Cfg { + fn default() -> Self { + Self::new() + } }