-
Notifications
You must be signed in to change notification settings - Fork 225
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
Replace error strings with enums #417
Replace error strings with enums #417
Conversation
Relates to #221 |
86c2ad2
to
17c11bb
Compare
Maybe I should add a conversion from the enum values to the error strings in https://github.com/capnproto/capnproto-rust/blob/6e421db3b13ead5e92cce68cff186a96492b7d1d/capnp-rpc/src/rpc.rs#L368C3-L368C3 since this test is failing capnproto-rust/capnp-rpc/test/test.rs Line 339 in 6e421db
|
I think there should be a conversion from enum values to more verbose messages, and that it should live in an |
17c11bb
to
fb28071
Compare
fb28071
to
46541fa
Compare
I think we can remove "except for error message" from the documentation with this PR. Do you have additional technical comments related to the code? |
Yep.
I think this is in pretty good shape. The main barrier to merging now is that it's a breaking change, so we'll need to bump to version 0.18. To minimize churn, it might be good to try to fit some other pending breaking changes (for example #380) in with that version bump. How time-sensitive is this change for you? |
I'm in no rush at all, I just wanted to finish with this PR. I'm still working on getting capnp to compile in the kernel, so I might open other PRs with |
This is useful in `no alloc` scenarios and in cases where String is not available (such as the Linux kernel).
46541fa
to
5414689
Compare
Please feel free to add those changes to this PR, if it makes sense to do so. |
This allows us to compile capnproto in no-alloc environments.
I need some help with the remaining
|
6e70f4c
to
71eb2e4
Compare
Do those clippy warnings also get reported on the |
Ok, I will open a subsequent PR for the clippy changes. |
71eb2e4
to
873a1b7
Compare
There are some formatting changes with the latest nightly version of rust, I included these changes as a separate commit, let me know if you would like to see them squashed in another commit, I'm not sure what the best practice is in this situation. |
I enabled more code in 579b4f4, allowing run-time reflection to still work in the no-alloc case. After this change, examples/wasm-hello-world works with capnp in no-alloc mode. |
Kudos for this, I know it was very tedious work |
Btw, here's my perl script I've used to (semi)automate the replacements (in case someone wants to do the same for the other error strings): https://gist.github.com/ariel-miculas/e114394eccda9563434c1ad5af19c797 |
I'm now thinking that the release will be at least a few weeks from now. |
This is useful in
no alloc
scenarios and in cases where String is notavailable (such as the Linux kernel).