Skip to content
This repository was archived by the owner on Oct 21, 2026. It is now read-only.

Commit 6a28e7f

Browse files
authored
Dependency cleanup (#127)
1 parent 2f97423 commit 6a28e7f

3 files changed

Lines changed: 14 additions & 19 deletions

File tree

‎Cargo.toml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@ allow_deprecated = []
2121
naga = { version = "26", features = ["wgsl-in", "wgsl-out", "termcolor"] }
2222
tracing = "0.1"
2323
regex = "1.8"
24-
regex-syntax = "0.8"
2524
thiserror = "2.0"
2625
codespan-reporting = "0.12"
2726
data-encoding = "2.3.2"
28-
bit-set = "0.8"
2927
rustc-hash = "1.1"
3028
unicode-ident = "1"
31-
once_cell = "1.17.0"
3229
indexmap = "2"
3330

3431
[dev-dependencies]

‎src/compose/comment_strip_iter.rs‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
use std::{borrow::Cow, str::Lines};
22

33
use regex::Regex;
4+
use std::sync::LazyLock;
45

56
// outside of blocks and quotes, change state on //, /* or "
6-
static RE_NONE: once_cell::sync::Lazy<Regex> =
7-
once_cell::sync::Lazy::new(|| Regex::new(r#"(//|/\*|\")"#).unwrap());
7+
static RE_NONE: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"(//|/\*|\")"#).unwrap());
88
// in blocks, change on /* and */
9-
static RE_BLOCK: once_cell::sync::Lazy<Regex> =
10-
once_cell::sync::Lazy::new(|| Regex::new(r"(/\*|\*/)").unwrap());
9+
static RE_BLOCK: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(/\*|\*/)").unwrap());
1110
// in quotes, change only on "
12-
static RE_QUOTE: once_cell::sync::Lazy<Regex> =
13-
once_cell::sync::Lazy::new(|| Regex::new(r#"\""#).unwrap());
11+
static RE_QUOTE: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"\""#).unwrap());
1412

1513
#[derive(PartialEq, Eq)]
1614
enum CommentState {

‎src/compose/mod.rs‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ use indexmap::IndexMap;
130130
use naga::EntryPoint;
131131
use regex::Regex;
132132
use std::collections::{hash_map::Entry, BTreeMap, HashMap, HashSet};
133+
use std::sync::LazyLock;
133134
use tracing::{debug, trace};
134135

135136
use crate::{
@@ -348,17 +349,17 @@ impl Default for Composer {
348349
check_decoration_regex: Regex::new(
349350
format!(
350351
"({}|{})",
351-
regex_syntax::escape(DECORATION_PRE),
352-
regex_syntax::escape(DECORATION_OVERRIDE_PRE)
352+
regex::escape(DECORATION_PRE),
353+
regex::escape(DECORATION_OVERRIDE_PRE)
353354
)
354355
.as_str(),
355356
)
356357
.unwrap(),
357358
undecorate_regex: Regex::new(
358359
format!(
359360
r"(\x1B\[\d+\w)?([\w\d_]+){}([A-Z0-9]*){}",
360-
regex_syntax::escape(DECORATION_PRE),
361-
regex_syntax::escape(DECORATION_POST)
361+
regex::escape(DECORATION_PRE),
362+
regex::escape(DECORATION_POST)
362363
)
363364
.as_str(),
364365
)
@@ -370,17 +371,17 @@ impl Default for Composer {
370371
override_fn_regex: Regex::new(
371372
format!(
372373
r"(override\s+fn\s+)([^\s]+){}([\w\d]+){}(\s*)\(",
373-
regex_syntax::escape(DECORATION_PRE),
374-
regex_syntax::escape(DECORATION_POST)
374+
regex::escape(DECORATION_PRE),
375+
regex::escape(DECORATION_POST)
375376
)
376377
.as_str(),
377378
)
378379
.unwrap(),
379380
undecorate_override_regex: Regex::new(
380381
format!(
381382
"{}([A-Z0-9]*){}",
382-
regex_syntax::escape(DECORATION_OVERRIDE_PRE),
383-
regex_syntax::escape(DECORATION_POST)
383+
regex::escape(DECORATION_OVERRIDE_PRE),
384+
regex::escape(DECORATION_POST)
384385
)
385386
.as_str(),
386387
)
@@ -1927,8 +1928,7 @@ impl Composer {
19271928
}
19281929
}
19291930

1930-
static PREPROCESSOR: once_cell::sync::Lazy<Preprocessor> =
1931-
once_cell::sync::Lazy::new(Preprocessor::default);
1931+
static PREPROCESSOR: LazyLock<Preprocessor> = LazyLock::new(Preprocessor::default);
19321932

19331933
/// Get module name and all required imports (ignoring shader_defs) from a shader string
19341934
pub fn get_preprocessor_data(

0 commit comments

Comments
 (0)