Skip to content

Commit 03b09c2

Browse files
adsnaiderAdam Snaider
andauthored
Change template engine to askama to fix problem with bazel (#110)
Co-authored-by: Adam Snaider <asnaider@google.com>
1 parent 63d43ac commit 03b09c2

10 files changed

Lines changed: 1480 additions & 1007 deletions

File tree

Cargo.lock

Lines changed: 107 additions & 142 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cspell-words.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,5 @@ ifdef
105105
selectany
106106
declspec
107107
elif
108+
askama
109+
endfor

zngur-def/src/lib.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,26 @@ pub enum ZngurFieldDataOffset {
7575
Auto(String),
7676
}
7777

78+
impl ZngurFieldDataOffset {
79+
pub fn is_offset(&self) -> bool {
80+
matches!(self, ZngurFieldDataOffset::Offset(_))
81+
}
82+
83+
pub fn as_offset(&self) -> Option<usize> {
84+
match self {
85+
ZngurFieldDataOffset::Offset(o) => Some(*o),
86+
_ => None,
87+
}
88+
}
89+
90+
pub fn as_auto(&self) -> Option<&str> {
91+
match self {
92+
ZngurFieldDataOffset::Auto(s) => Some(s),
93+
_ => None,
94+
}
95+
}
96+
}
97+
7898
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
7999
pub enum ZngurWellknownTrait {
80100
Debug,

0 commit comments

Comments
 (0)