aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon THOBY <git@nightmared.fr>2023-01-08 22:38:09 +0100
committerSimon THOBY <git@nightmared.fr>2023-01-08 22:38:09 +0100
commit12a055ca570d814e5b213191e3847d5bffc8b9d5 (patch)
treeeb30e7c6dd3c3c4da0168d845c911d3f645e7d2f
parentdc3c2ffab697b5d8fce7c69f76528fcfdf2edf38 (diff)
build.rs: minor cleanup
-rw-r--r--Cargo.nix4
-rw-r--r--Cargo.toml2
-rw-r--r--build.rs7
3 files changed, 2 insertions, 11 deletions
diff --git a/Cargo.nix b/Cargo.nix
index 5a51652..2b83f63 100644
--- a/Cargo.nix
+++ b/Cargo.nix
@@ -1056,10 +1056,6 @@ rec {
packageId = "bindgen";
}
{
- name = "lazy_static";
- packageId = "lazy_static";
- }
- {
name = "regex";
packageId = "regex";
}
diff --git a/Cargo.toml b/Cargo.toml
index 8391917..292a606 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,5 +28,3 @@ env_logger = "0.9"
[build-dependencies]
bindgen = "0.53.1"
regex = "1.5.4"
-lazy_static = "1.4.0"
-
diff --git a/build.rs b/build.rs
index a39bbc3..b92653d 100644
--- a/build.rs
+++ b/build.rs
@@ -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])
})
}