-
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
Redefine Error
s interface
#124
Comments
@torymur but with this change, we will have to update code at all places which uses // Convert from ErrorImpl to Error
impl From<ErrorImpl> for Error {
fn from(err_impl: ErrorImpl) -> Self {
Error(Box::new(err_impl))
}
} And replacing this: Err(Error::IndexError) with this: Err(ErrorImpl::IndexError.into()) Another option is to use constructor methods, I am not sure which design pattern would be better, lmk your thoughts on this. |
Hey @sky-2002 Apologies, I now assigned myself to this issue and I will figure out a better way to communicate issues like this, which is more of a note to not forget, rather than anything actionable (even for a better thought than in description). This part of the project is in the middle of heavy refactoring and is not stabilized yet enough to answer here right now. |
@torymur ahh right, thanks for clearing, thought as much, it did look like a note to not to forget, my bad 🙌🏻 . |
Cool, will check out those. |
We would like to keep the size of
Error
as small as possible (currently, it's 48 bytes already).So it needs to be defined as a struct with
Box
ed inner error, in the same manner as it's done inserde_json
orreqwest
:https://github.com/serde-rs/json/blob/master/src/error.rs
https://github.com/seanmonstar/reqwest/blob/master/src/error.rs
The text was updated successfully, but these errors were encountered: