-
Notifications
You must be signed in to change notification settings - Fork 96
Conversation
src/interpreter/mod.rs
Outdated
@@ -1,8 +1,12 @@ | |||
//! WebAssembly interpreter module. | |||
|
|||
/// Interpreter error. | |||
/// Custom user error. | |||
pub trait CustomUserError: 'static + ::std::fmt::Display + ::std::fmt::Debug + Clone + PartialEq { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe call it UserError?
I'm worried about a lot entries in public api are named as SomethingSomethingThing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed
src/interpreter/mod.rs
Outdated
} | ||
} | ||
} | ||
|
||
/// Dummy user error. | ||
#[derive(Debug, Clone, PartialEq)] | ||
pub struct DummyCustomUserError; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe call it just Dummy
and refer as error::Dummy
everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you're suggesting to add additional namespace (error) and move this struct over there (maybe I got it wrong)? Looks like additional headache for me, but if you feel this is ok - please insist.
For now I have renamed it to DummyUserError
&& added alias DummyError
for Error<DummyUserError>
. Unfortunately, because of this issue: rust-lang/rust#26264 you still need to import both Error
&& DummyError
, if you want to access Error
variants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, it's ok with just rename
closes #20
Most significant API changes:
: ::std::fmt::Display + ::std::fmt::Debug + Clone + PartialEq
Most of changes are just cosmetic (propagating generic parameter). Example is in
native_custom_error