update
This commit is contained in:
parent
79c2b417c2
commit
2150f796a7
4
rust.h
4
rust.h
|
@ -17,14 +17,12 @@
|
||||||
#define Result_impl(T, E) \
|
#define Result_impl(T, E) \
|
||||||
typedef struct { \
|
typedef struct { \
|
||||||
bool is_valid; \
|
bool is_valid; \
|
||||||
union { \
|
enum { \
|
||||||
T data; \
|
T data; \
|
||||||
E err; \
|
E err; \
|
||||||
}; \
|
}; \
|
||||||
} Result_##T##_##E;
|
} Result_##T##_##E;
|
||||||
|
|
||||||
#define Result(T, E) Result_##T##_##E
|
#define Result(T, E) Result_##T##_##E
|
||||||
|
|
||||||
#define Result_unwrap_impl(T, E) \
|
#define Result_unwrap_impl(T, E) \
|
||||||
T Result_##T##_unwrap (Result(T, E) result) { \
|
T Result_##T##_unwrap (Result(T, E) result) { \
|
||||||
if (result.is_valid) \
|
if (result.is_valid) \
|
||||||
|
|
Loading…
Reference in a new issue