浏览代码

Add support to BigUint.from_str_radix() for using _ as a visual separator

str4d 7 年之前
父节点
当前提交
720893f67b
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      bigint/src/biguint.rs

+ 1 - 0
bigint/src/biguint.rs

@@ -243,6 +243,7 @@ impl Num for BigUint {
                 b'0'...b'9' => b - b'0',
                 b'a'...b'z' => b - b'a' + 10,
                 b'A'...b'Z' => b - b'A' + 10,
+                b'_' => continue,
                 _ => u8::MAX,
             };
             if d < radix as u8 {