This commit is contained in:
Able 2021-11-05 08:43:53 -05:00
parent 79c2b417c2
commit 2150f796a7

4
rust.h
View file

@ -17,14 +17,12 @@
#define Result_impl(T, E) \
typedef struct { \
bool is_valid; \
union { \
enum { \
T data; \
E err; \
}; \
} Result_##T##_##E;
#define Result(T, E) Result_##T##_##E
#define Result_unwrap_impl(T, E) \
T Result_##T##_unwrap (Result(T, E) result) { \
if (result.is_valid) \