-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More specific error types #16
Comments
Hi @not-my-profile, That is a good idea. We could even add a Greets |
Yes of course. But I can not guarantee you how fast I can merge it. Last time one week escalated into 2 years, but I don't think this will happen with this :) . Greets |
Thanks, for the quick answer :) Could you format your code with |
I decided agains using rust fmt in this library as it made the testcases where raw bytes are used harder to read (e.g. etherparse/tests/transport/tcp.rs Line 1473 in 36f8f7f
|
Ah yeah ... adding |
Hi, I had a closer look at the error types and I will probably restructure them quite a bit in the next release. Specifically also splitting them up based on the operation: That should hopefully also resolve your request, but will allow me to separate |
Finalized by #64 |
Hey, thanks for your library :) I want to use the manual slicing methods but noticed that they all return the ReadError enum, which contains variants that cannot actually occur.
For example with
Ethernet2HeaderSlice.from_slice
the only error variant that can actually occur isUnexpectedEndOfSlice
.Would you accept a PR changing
ReadError
to something like the following?Ethernet2HeaderSlice.from_slice
would then return aResult<Ethernet2HeaderSlice<'a>, UnexpectedEndOfSliceError>
Ipv4HeaderSlice.from_slice
would then return aResult<Ipv4HeaderSlice<'a>, Ipv4Error>
The text was updated successfully, but these errors were encountered: