Skip to content

Commit 10952e8

Browse files
committed
barcode: Fix inaccurate comment and remove redundant info
These comments reproduce the data in the match patterns immediately below them which makes for errors like this. Better to let the match arm patterns speak for themselves.
1 parent f31d365 commit 10952e8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

barcode/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,12 +835,12 @@ impl<'a> TryFrom<&'a str> for Barcode<'a> {
835835

836836
// the prefix determines permitted formats for the part number
837837
match prefix {
838-
// 0XV1 must be in v1 format
838+
// must be in v1 format
839839
Prefix::ZeroXV1 => match part {
840840
Part::V1(_) => (),
841841
_ => return Err(Self::Error::PartNotV1),
842842
},
843-
// 0XV1, 0XV2 and PDV2 must be in v2 format
843+
// must be in v2 format
844844
Prefix::PDV1 | Prefix::ZeroXV2 | Prefix::PDV2 => match part {
845845
Part::V2(_) => (),
846846
_ => return Err(Self::Error::PartNotV2),
@@ -867,12 +867,12 @@ impl<'a> TryFrom<&'a str> for Barcode<'a> {
867867

868868
// the prefix determines permitted formats for the serial number
869869
match prefix {
870-
// 0XV1 or PDV1: must be in v1 format
870+
// must be in v1 format
871871
Prefix::ZeroXV1 | Prefix::PDV1 => match serial {
872872
Serial::V1(_) => (),
873873
_ => return Err(Self::Error::SerialNotV1),
874874
},
875-
// 0XV2 or PDV2: may be in v1 or v2 format
875+
// may be in v1 or v2 format
876876
Prefix::ZeroXV2 | Prefix::PDV2 => match serial {
877877
Serial::V1(_) | Serial::V2(_) => (),
878878
},

0 commit comments

Comments
 (0)