mirror of
https://github.com/typst/typst
synced 2025-05-15 01:25:28 +08:00
11 lines
249 B
Rust
11 lines
249 B
Rust
/// Unwrap the option if it is `Some(T)` or evaluate `$or` if it is `None`.
|
|
#[allow(unused)]
|
|
macro_rules! try_or {
|
|
($option:expr, $or:expr $(,)?) => {
|
|
match $option {
|
|
Some(v) => v,
|
|
None => $or,
|
|
}
|
|
};
|
|
}
|