Skip to content

Commit 2b0681f

Browse files
committed
Replace guard with range pattern
1 parent 185b35d commit 2b0681f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/serializer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ impl<'a, W> fmt::Write for CssStringWriter<'a, W> where W: fmt::Write {
257257
b'\n' => "\\A ",
258258
b'\r' => "\\D ",
259259
b'\0' => "\u{FFFD}",
260-
x if (x >= b'\x01' && x <= b'\x1F') || x == b'\x7F' => {
261-
string = format!("\\{:x} ", x);
260+
b'\x01'...b'\x1F' | b'\x7F' => {
261+
string = format!("\\{:x} ", b);
262262
&string
263263
},
264264
_ => continue,

0 commit comments

Comments
 (0)