Skip to content

Commit 1dd745e

Browse files
committed
fixup! Add parsing and serialization for <urange>
1 parent 3d4d571 commit 1dd745e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/unicode_range.rs

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use tokenizer::{Token, NumericValue};
1414
/// One contiguous range of code points.
1515
///
1616
/// Can not be empty. Can represent a single code point when start == end.
17+
#[derive(PartialEq, Eq, Clone, Hash)]
1718
pub struct UnicodeRange {
1819
/// Inclusive start of the range. In [0, end].
1920
pub start: u32,
@@ -204,6 +205,12 @@ fn consume_question_marks(text: &mut &[u8]) -> usize {
204205
question_marks
205206
}
206207

208+
impl fmt::Debug for UnicodeRange {
209+
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
210+
self.to_css(formatter)
211+
}
212+
}
213+
207214
impl ToCss for UnicodeRange {
208215
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
209216
dest.write_str("U+")?;

0 commit comments

Comments
 (0)