Explorar el Código

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

str4d hace 7 años
padre
commit
720893f67b
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  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 {