mirror of
https://github.com/apple/swift-nio-imap
synced 2026-11-26 04:57:51 +00:00
A "message identifier" can be a UID, a SequenceNumber, or an unknown instance of the two (because they look the same it's impossible to distinguish when parsing). Originally we had the 3 types duplicated 3 times, however this PR brings us closer to have one implementation. While code duplication isn't usually "that bad", in this case it can be an issue as : The code is complicated There's a lot of it This PR works to address a few things, using the UID type as a proof-of-concept: Make UID conform to a protocol MessageIdentifier Create a new MessageIdentifierRange type that will eventually replace the UIDRange and SequenceNumberRange types.