about summary refs log tree commit diff
path: root/src/libcore/str/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/str/mod.rs')
-rw-r--r--src/libcore/str/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs
index 305546df5be..f1be10da872 100644
--- a/src/libcore/str/mod.rs
+++ b/src/libcore/str/mod.rs
@@ -1940,7 +1940,8 @@ impl StrExt for str {
         if index == 0 || index == self.len() { return true; }
         match self.as_bytes().get(index) {
             None => false,
-            Some(&b) => b < 128 || b >= 192,
+            // This is bit magic equivalent to: b < 128 || b >= 192
+            Some(&b) => (b as i8) >= -0x40,
         }
     }