about summary refs log tree commit diff
path: root/compiler/rustc_serialize/src/json.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_serialize/src/json.rs')
-rw-r--r--compiler/rustc_serialize/src/json.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_serialize/src/json.rs b/compiler/rustc_serialize/src/json.rs
index 6c8965aa2e3..bbbe568f17a 100644
--- a/compiler/rustc_serialize/src/json.rs
+++ b/compiler/rustc_serialize/src/json.rs
@@ -1859,7 +1859,7 @@ impl<T: Iterator<Item = char>> Parser<T> {
                             }
 
                             let n2 = self.decode_hex_escape()?;
-                            if n2 < 0xDC00 || n2 > 0xDFFF {
+                            if !(0xDC00..=0xDFFF).contains(&n2) {
                                 return self.error(LoneLeadingSurrogateInHexEscape);
                             }
                             let c =