Skip to content

Commit adbae82

Browse files
committed
chore: Write proper english in comments
1 parent 093a504 commit adbae82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/input/shared.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,18 @@ fn clean_int_str(mut s: &str) -> Option<Cow<str>> {
122122
s = suffix;
123123
}
124124

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
127127
// 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.
129129
let mut is_negative = false;
130130
if let Some(suffix) = s.strip_prefix('-') {
131131
if suffix.starts_with('-') | suffix.starts_with('+') {
132132
return None;
133133
}
134134

135135
is_negative = true;
136-
// Continue without prefixing unary sign
136+
// Continue as usual without the unary minus sign
137137
s = suffix;
138138
}
139139

0 commit comments

Comments
 (0)