Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ bindgen = "=0.69.4"
heck = "0.5"
itertools = "0.14"
nom = "8"
once_cell = "1.7"
proc-macro2 = "1.0"
quote = "1.0"
regex = "1.4"
Expand Down
6 changes: 3 additions & 3 deletions generator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use nom::{
sequence::{delimited, pair, preceded, separated_pair, terminated},
IResult, Parser,
};
use once_cell::sync::Lazy;
use proc_macro2::{Delimiter, Group, Literal, Span, TokenStream, TokenTree};
use quote::*;
use regex::Regex;
Expand All @@ -31,6 +30,7 @@ use std::{
fmt::Display,
ops::Not,
path::Path,
sync::LazyLock,
};
use syn::Ident;

Expand Down Expand Up @@ -326,7 +326,7 @@ pub trait ConstantExt {
fn variant_ident(&self, enum_name: &str) -> Ident;
fn notation(&self) -> Option<&str>;
fn formatted_notation(&self) -> Option<Cow<'_, str>> {
static DOC_LINK: Lazy<Regex> = Lazy::new(|| Regex::new(r"<<([\w-]+)>>").unwrap());
static DOC_LINK: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"<<([\w-]+)>>").unwrap());
self.notation().map(|n| {
DOC_LINK.replace(
n,
Expand Down Expand Up @@ -1586,7 +1586,7 @@ pub enum EnumType {
Enum(TokenStream),
}

static TRAILING_NUMBER: Lazy<Regex> = Lazy::new(|| Regex::new("(\\d+)$").unwrap());
static TRAILING_NUMBER: LazyLock<Regex> = LazyLock::new(|| Regex::new("(\\d+)$").unwrap());

pub fn variant_ident(enum_name: &str, variant_name: &str) -> Ident {
let variant_name = variant_name.to_uppercase();
Expand Down