Skip to content

Commit 3f98f13

Browse files
committed
Export parse_color_keyword for use in legacy HTML color parsing.
I could have gotten around the privacy restriction by synthesizing a fake CSS AST and parsing that, but that would have been less efficient.
1 parent cbbfd66 commit 3f98f13

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/color.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl Color {
6060

6161

6262
#[inline]
63-
fn parse_color_keyword(value: &str) -> Result<Color, ()> {
63+
pub fn parse_color_keyword(value: &str) -> Result<Color, ()> {
6464
let lower_value = value.to_ascii_lower();
6565
let (r, g, b) = match lower_value.as_slice() {
6666
"black" => (0., 0., 0.),

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extern crate test;
1515
#[cfg(test)]
1616
extern crate serialize;
1717

18+
pub use color::{parse_color_keyword};
1819
pub use tokenizer::{tokenize, Tokenizer};
1920
pub use parser::{parse_stylesheet_rules, StylesheetParser,
2021
parse_rule_list, RuleListParser,

0 commit comments

Comments
 (0)