diff options
author | Simon THOBY <git@nightmared.fr> | 2023-01-08 22:38:09 +0100 |
---|---|---|
committer | Simon THOBY <git@nightmared.fr> | 2023-01-08 22:38:09 +0100 |
commit | 12a055ca570d814e5b213191e3847d5bffc8b9d5 (patch) | |
tree | eb30e7c6dd3c3c4da0168d845c911d3f645e7d2f | |
parent | dc3c2ffab697b5d8fce7c69f76528fcfdf2edf38 (diff) |
build.rs: minor cleanup
-rw-r--r-- | Cargo.nix | 4 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | build.rs | 7 |
3 files changed, 2 insertions, 11 deletions
@@ -1056,10 +1056,6 @@ rec { packageId = "bindgen"; } { - name = "lazy_static"; - packageId = "lazy_static"; - } - { name = "regex"; packageId = "regex"; } @@ -28,5 +28,3 @@ env_logger = "0.9" [build-dependencies] bindgen = "0.53.1" regex = "1.5.4" -lazy_static = "1.4.0" - @@ -1,7 +1,6 @@ //! This build script leverages `bindgen` to generate rust sys files. use bindgen; -use lazy_static::lazy_static; use regex::{Captures, Regex}; use std::borrow::Cow; use std::fs::File; @@ -49,10 +48,8 @@ fn generate_sys() { /// Recast nft_*_attributes from u32 to u16 in header string `header`. fn reformat_units(header: &str) -> Cow<str> { - lazy_static! { - static ref RE: Regex = Regex::new(r"(pub type nft[a-zA-Z_]*_attributes) = u32;").unwrap(); - } - RE.replace_all(header, |captures: &Captures| { + let re = Regex::new(r"(pub type nft[a-zA-Z_]*_attributes) = u32;").unwrap(); + re.replace_all(header, |captures: &Captures| { format!("{} = u16;", &captures[1]) }) } |