File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -122,18 +122,18 @@ fn clean_int_str(mut s: &str) -> Option<Cow<str>> {
122
122
s = suffix;
123
123
}
124
124
125
- // Remember whether the number is negative
126
- // the strip_leading_zeros function will not strip leading zeros on negative numbers
125
+ // Remember if the number is negative
126
+ // the ` strip_leading_zeros` function will not strip leading zeros for negative numbers
127
127
// therefore we simply "take away" the unary minus sign temporarily and add it back before
128
- // returning
128
+ // returning. This allows consistent handling of leading zeros for both positive and negative numbers.
129
129
let mut is_negative = false ;
130
130
if let Some ( suffix) = s. strip_prefix ( '-' ) {
131
131
if suffix. starts_with ( '-' ) | suffix. starts_with ( '+' ) {
132
132
return None ;
133
133
}
134
134
135
135
is_negative = true ;
136
- // Continue without prefixing unary sign
136
+ // Continue as usual without the unary minus sign
137
137
s = suffix;
138
138
}
139
139
You can’t perform that action at this time.
0 commit comments