diff options
author | HampusM <hampus@hampusmat.com> | 2024-04-25 20:48:39 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-05-01 19:18:03 +0200 |
commit | 9530d22cf5369ceba369487fff1b85376da64657 (patch) | |
tree | 5beeaa594e77a32877336e119035197e8cd5ac9d /engine/src/util.rs | |
parent | 33f7772ddddf2a1c2bfefc50ef39f123df8af3e4 (diff) |
feat(engine): add basic Wavefront obj file parsing
Diffstat (limited to 'engine/src/util.rs')
-rw-r--r-- | engine/src/util.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/engine/src/util.rs b/engine/src/util.rs new file mode 100644 index 0000000..021b2fe --- /dev/null +++ b/engine/src/util.rs @@ -0,0 +1,24 @@ +macro_rules! try_option { + ($expr: expr) => { + match $expr { + Ok(value) => value, + Err(err) => { + return Some(Err(err)); + } + } + }; +} + +pub(crate) use try_option; + +macro_rules! or { + (($($tt: tt)+) else ($($else_tt: tt)*)) => { + $($tt)+ + }; + + (() else ($($else_tt: tt)*)) => { + $($else_tt)* + }; +} + +pub(crate) use or; |