We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 445c106 commit 1d1c12aCopy full SHA for 1d1c12a
src/types/int_type.rs
@@ -45,7 +45,7 @@ impl StringRadix {
45
/// Is the string valid for the given radix?
46
pub fn matches_str(&self, slice: &str) -> bool {
47
// drop 1 optional + or -
48
- let slice = slice.strip_prefix(|c| c == '+' || c == '-'));
+ let slice = slice.strip_prefix(|c| c == '+' || c == '-').unwrap_or(slice);
49
50
// there must be at least 1 actual digit
51
if slice.is_empty() {
0 commit comments