| 6 | using namespace wasmtime; |
| 7 | |
| 8 | template <typename T, typename E> T unwrap(Result<T, E> result) { |
| 9 | if (result) { |
| 10 | return result.ok(); |
| 11 | } |
| 12 | std::cerr << "error: " << result.err().message() << "\n"; |
| 13 | std::abort(); |
| 14 | } |
| 15 | |
| 16 | std::string readFile(const char *name) { |
| 17 | std::ifstream watFile; |