Skip to content

Commit cb1bfcd

Browse files
committed
tweak some comment
1 parent 80b342b commit cb1bfcd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

crates/pep508-rs/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,15 @@ fn parse_extras(cursor: &mut Cursor) -> Result<Vec<ExtraName>, Pep508Error> {
623623
loop {
624624
cursor.eat_whitespace();
625625

626-
// end of the extras section
626+
// End of the extras section
627627
if let Some(']') = cursor.peek_char() {
628628
cursor.next();
629629
break;
630630
}
631631

632-
// comma separator, except for the first iteration
632+
// Comma separator
633633
match (cursor.peek(), is_first_iteration) {
634+
// For the first iteration, we don't expect a comma
634635
(Some((pos, ',')), true) => {
635636
return Err(Pep508Error {
636637
message: Pep508ErrorSource::String(
@@ -641,6 +642,7 @@ fn parse_extras(cursor: &mut Cursor) -> Result<Vec<ExtraName>, Pep508Error> {
641642
input: cursor.to_string(),
642643
});
643644
}
645+
// For the other iterations, the comma is required
644646
(Some((_, ',')), false) => {
645647
cursor.next();
646648
}
@@ -708,8 +710,9 @@ fn parse_extras(cursor: &mut Cursor) -> Result<Vec<ExtraName>, Pep508Error> {
708710
}
709711
_ => {}
710712
};
711-
cursor.eat_whitespace();
712713
// wsp* after the identifier
714+
cursor.eat_whitespace();
715+
// Add the parsed extra
713716
extras.push(
714717
ExtraName::new(buffer).expect("`ExtraName` validation should match PEP 508 parsing"),
715718
);

0 commit comments

Comments
 (0)