autocommit 2022-01-25 16:45:44 CET
This commit is contained in:
parent
0336bf3bde
commit
c340df0d08
59 changed files with 3085 additions and 1710 deletions
1
build.rs
1
build.rs
|
|
@ -53,6 +53,7 @@ fn get_enum_ty(variants: Vec<i128>) -> anyhow::Result<u64> {
|
|||
fn write_ty<W: Write>(f: &mut W, vals: &[u32], ty: &str) -> anyhow::Result<()> {
|
||||
let variants: Vec<_> = vals.iter().cloned().map(|v| v as i128).collect();
|
||||
let size = get_enum_ty(variants)?;
|
||||
writeln!(f, "#[allow(dead_code)]")?;
|
||||
writeln!(f, "pub type {} = u{};", ty, size)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue