diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-02-12 18:58:39 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-02-12 19:57:28 +0100 |
| commit | 3ffa7393f0632d9ee5dd9c821685a1a033d5c0ab (patch) | |
| tree | af09b0683352c4028436a2e5251dce54cf41d4aa /src/geom/smart.rs | |
| parent | f4856c18b9cf3f6952276cc61b557aebeb2fa651 (diff) | |
Make all nodes block-level
Diffstat (limited to 'src/geom/smart.rs')
| -rw-r--r-- | src/geom/smart.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/geom/smart.rs b/src/geom/smart.rs index d20bcdfe..e115e99d 100644 --- a/src/geom/smart.rs +++ b/src/geom/smart.rs @@ -10,6 +10,16 @@ pub enum Smart<T> { } impl<T> Smart<T> { + /// Whether the value is `Auto`. + pub fn is_auto(&self) -> bool { + matches!(self, Self::Auto) + } + + /// Whether this holds a custom value. + pub fn is_custom(&self) -> bool { + matches!(self, Self::Custom(_)) + } + /// Map the contained custom value with `f`. pub fn map<F, U>(self, f: F) -> Smart<U> where |
