From 85c5658d04b4cf54fe6f05e15ec21637f4febf30 Mon Sep 17 00:00:00 2001 From: James Edmonds Date: Sat, 15 Jan 2022 05:18:42 +0000 Subject: [PATCH] feat: added static method StyleSheet::new --- src/stylesheet.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/stylesheet.rs b/src/stylesheet.rs index 3286ed5e..cc3c9ec7 100644 --- a/src/stylesheet.rs +++ b/src/stylesheet.rs @@ -44,6 +44,14 @@ pub struct ToCssResult { } impl StyleSheet { + pub fn new(filename: String, rules: CssRuleList, options: ParserOptions) -> StyleSheet { + StyleSheet { + filename, + rules, + options + } + } + pub fn parse<'i>(filename: String, code: &'i str, options: ParserOptions) -> Result>> { let mut input = ParserInput::new(&code); let mut parser = Parser::new(&mut input);