You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Motivation
The current error type, ErrorKind, contains a ton of irrelevant information. For example, the InvalidCharacter variant contains the expected characters, which shouldn't have to be a field carried around. All the fields holding an ExpectedLength are also redundant, because they are known and do not vary.
Solution
Revise the error type to contain more relevant information like the following:
enumUuidParseError{/// Non-hex character, potentially a multibyte characterChar{character:char,index:usize,width:usize,},/// A simple UUID didn't contain 32 charactersSimpleLength{len:usize,},/// A hyphenated UUID didn't contain 5 groupsGroupCount{count:usize,},/// A hyphenated UUID had a group that wasn't the right lengthGroupLength{group:usize,len:usize,offset:usize,},}
Alternatives
We could just not change it...
Is it blocking?
The information contained in the new error type is important for allowing the uuid!() proc-macro provide the most useful feedback, and I don't want to have multiple error types.
I'm pretty sure that this doesn't change the API in any way since the ErrorKind type was always private, so it shouldn't be breaking to any code unless someone was parsing the error message...
The text was updated successfully, but these errors were encountered:
Motivation
The current error type,
ErrorKind
, contains a ton of irrelevant information. For example, theInvalidCharacter
variant contains the expected characters, which shouldn't have to be a field carried around. All the fields holding anExpectedLength
are also redundant, because they are known and do not vary.Solution
Revise the error type to contain more relevant information like the following:
Alternatives
We could just not change it...
Is it blocking?
The information contained in the new error type is important for allowing the
uuid!()
proc-macro provide the most useful feedback, and I don't want to have multiple error types.I'm pretty sure that this doesn't change the API in any way since the
ErrorKind
type was always private, so it shouldn't be breaking to any code unless someone was parsing the error message...The text was updated successfully, but these errors were encountered: