Skip to content

Commit

Permalink
feat: added static method StyleSheet::new (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
deckchairlabs authored Jan 15, 2022
1 parent 8e4e2db commit 2e499d4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/stylesheet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<StyleSheet, ParseError<'i, ParserError<'i>>> {
let mut input = ParserInput::new(&code);
let mut parser = Parser::new(&mut input);
Expand Down

0 comments on commit 2e499d4

Please sign in to comment.