-
Notifications
You must be signed in to change notification settings - Fork 20
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
Error cleanup #53
base: develop
Are you sure you want to change the base?
Error cleanup #53
Conversation
Hey, so I just got some capacity to try out these changes. Overall, they look pretty good. Although, there is one significant problem right now blocking compilation, which you alluded to in your OP. It mainly appears in The main problem is, that previously we used the From/Into traits to be able to cleanly convert e.g. So we need some form of solution for this to get this wrapped up, as this was the strategy to bridge the error handling into the C FFI space (and then return from it in the wrapper). I'm not sure what the alternative solution would be, regardless, any change would break the C ABI which is kinda ruled out. Should we just make some helper functions to provide this functionality instead, as we can't implement the traits like they were done before? I think that's somewhat why I had the wrapper type for Result in the first place, so I could have these conversion traits applied to make various parts of the code simpler (although it did come at the cost of making a whole lot of the other code more annoying) |
btw, you can skip the cmake stuff by just commenting out the contents of the |
oh that was an easy fix haha
we could actually, but we shouldn't, as both source and target type are foreign. Helper functions are the way to go, I added 3 extension traits for this. its a bit boilerplate, but that's necessary to handle surrogate values properly the code compiles now |
turns
SDKResult<T>
into a type alias forResult<T, WootingAnalogResult>
to get rid of all the.0
s and.into()
ssince i am unable to get this project to compile (can't figure out how to setup cmake etc), this PR will inevitably have compile time errors, especially in the cases where
.into()
converted both the result type and the inner value at the same time (which is something you shouldn't be doing anyway). these errors should be fairly easy to fix, and i'm happy to help. i'd do it myself if i could