Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Move hostcall impl behind a Result<()> fn #40

Merged
merged 2 commits into from
Jul 23, 2019
Merged

Move hostcall impl behind a Result<()> fn #40

merged 2 commits into from
Jul 23, 2019

Conversation

kubkon
Copy link
Member

@kubkon kubkon commented Jul 22, 2019

This PR addresses @alexcrichton's great suggestion of moving the implementation of the majority of hostcalls into functions which return a Result<(), host::__wasi_errno_t>, and thus making use of the ? operator to streamline a lot of the processing.

NB This PR depends directly on #39, and in turn on #38.

@kubkon
Copy link
Member Author

kubkon commented Jul 22, 2019

cc @alexcrichton @sunfishcode

src/macros.rs Outdated Show resolved Hide resolved
@alexcrichton
Copy link
Collaborator

Looks reasonable to me! I don't have tons of opinions on organization, but I'm assuming that 99% of the movement here isn't changing code and is just match -> ?, so I've just got one thought about the macro before merging

@kubkon
Copy link
Member Author

kubkon commented Jul 23, 2019

Looks reasonable to me! I don't have tons of opinions on organization, but I'm assuming that 99% of the movement here isn't changing code and is just match -> ?, so I've just got one thought about the macro before merging

Yep, you got it!

@sunfishcode
Copy link
Member

Nice!

@sunfishcode sunfishcode merged commit 86ae6e3 into CraneStation:master Jul 23, 2019
@kubkon kubkon deleted the refactor branch July 24, 2019 03:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants