-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use enhanced enums #80
Comments
Dart 2.17 has just been released by the way :) https://medium.com/dartlang/dart-2-17-b216bfc80c5d |
Yes, got it, FFI updates and experimental RISCV support are good news for me with my IOT hat on. |
I just noticed that the option type numbers might also be an interesting place where the enhanced enums could be used. I'll try to come up with a PR for that soon. |
I started working on refactoring the |
A couple of minor things I noticed, which will likely resolve themselves with the re-write, but mentioning just in case. Not all codes are represented in if (isValid(code)) {
if (isRequest(code)) {
return 'Unknown Request [code {0}]'; // `$code` rather than `{0}`?
// ... Somewhat related: I suppose |
I think from this list, we could mark |
Done! :) |
Package re released at version 5.0.0. |
Thank you for releasing the new version, @shamblett! I think we could reopen this issue, though, as there are still a couple of places where enhanced enums could be used (see the task list above). |
Yes no.problem a bit overly aggressive with my tidy up. |
This is now also addressed by #122 and can be checked once the PR has been merged :) |
LGTM! |
When Dart 2.17 is released, enhanced enums will simplify our code a bit: dart-lang/sdk#47849
Examples:
CoapCode
could be broken down into int enumsCoapMediaType
could be int enumCoapMessageType
could be int enumRequest.observe
could be int enum?CoapDefinedAddress
could be string enum?The text was updated successfully, but these errors were encountered: