Skip to content

Conversation

@axic
Copy link
Member

@axic axic commented Dec 17, 2018

Depends on #50.


impl ModuleValidator for CheckStartFunc {
fn validate(&self, module: &Module) -> Result<bool, String> {
fn validate(&self, module: &Module) -> Result<bool, ModuleError> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative idea: Replace the current Result<bool, ModuleError> with a simpler ModuleResult which can have the variants Valid, Invalid, Mutated, Unsupported, Other(String)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@axic what do you think about this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One downside is that I think unwrap cannot be used in that case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, true. I just realized that the methods are implemented directly rather than via a trait. this is good for merge then?

@jakelang jakelang merged commit fa86c3e into master Dec 20, 2018
@jakelang jakelang deleted the module-error branch December 20, 2018 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants