Skip to content

Commit 9942a57

Browse files
committed
feat(deps): remove once_cell
1 parent 18d57ba commit 9942a57

File tree

33 files changed

+76
-74
lines changed

33 files changed

+76
-74
lines changed

Cargo.lock

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.0.1"
44
edition = "2021"
55
license = "MPL-2.0"
66
authors = ["Florian Dieminger <[email protected]>"]
7+
rust-version = "1.80"
78

89
[workspace]
910
resolver = "2"
@@ -29,6 +30,7 @@ version = "0.0.1"
2930
edition = "2021"
3031
license = "MPL-2.0"
3132
authors = ["Florian Dieminger <[email protected]>"]
33+
rust-version = "1.80"
3234

3335
[dependencies]
3436
anyhow = "1"

crates/css-definition-syntax/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version.workspace = true
44
edition.workspace = true
55
authors.workspace = true
66
license.workspace = true
7+
rust-version.workspace = true
78

89
[dependencies]
910
thiserror = "1"

crates/css-syntax-types/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version.workspace = true
44
edition.workspace = true
55
authors.workspace = true
66
license.workspace = true
7+
rust-version.workspace = true
78

89
[dependencies]
910
regress = "0.10"

crates/css-syntax/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ version.workspace = true
44
edition.workspace = true
55
authors.workspace = true
66
license.workspace = true
7+
rust-version.workspace = true
78

89
[dependencies]
9-
once_cell = "1"
1010
thiserror = "1"
1111
regress = "0.10"
1212
serde_json = { version = "1", features = ["preserve_order"] }

crates/css-syntax/src/syntax.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ use std::cmp::{max, min, Ordering};
22
use std::collections::{BTreeMap, HashMap, HashSet};
33
use std::fmt::Write;
44
use std::fs;
5+
use std::sync::LazyLock;
56

67
use css_definition_syntax::generate::{self, GenerateOptions};
78
use css_definition_syntax::parser::{parse, CombinatorType, Multiplier, Node, Type};
89
use css_definition_syntax::walk::{walk, WalkOptions};
910
use css_syntax_types::{Css, CssValueType, CssValuesItem};
10-
use once_cell::sync::Lazy;
1111
#[cfg(all(feature = "rari", not(test)))]
1212
use rari_types::globals::data_dir;
1313
use serde::Serialize;
1414

1515
use crate::error::SyntaxError;
1616

17-
static CSS_REF: Lazy<BTreeMap<String, Css>> = Lazy::new(|| {
17+
static CSS_REF: LazyLock<BTreeMap<String, Css>> = LazyLock::new(|| {
1818
#[cfg(test)]
1919
{
2020
let package_path = std::path::Path::new("package");
@@ -64,7 +64,7 @@ pub struct Flattened {
6464
// This relies on the ordered names of CSS_REF.
6565
// "css-values-5" comes after "css-values" and therefore the updated
6666
// overlapping values in "css-values-5" are ignored.
67-
static FLATTENED: Lazy<Flattened> = Lazy::new(|| {
67+
static FLATTENED: LazyLock<Flattened> = LazyLock::new(|| {
6868
let mut all = Flattened::default();
6969
let mut entries = CSS_REF.iter().collect::<Vec<_>>();
7070
entries.sort_by(|a, b| {
@@ -746,7 +746,7 @@ fn get_nodes_for_syntaxes(
746746
mod test {
747747
use super::*;
748748

749-
static TOOLTIPS: Lazy<HashMap<LinkedToken, String>> = Lazy::new(|| {
749+
static TOOLTIPS: LazyLock<HashMap<LinkedToken, String>> = LazyLock::new(|| {
750750
[(LinkedToken::Asterisk, "Asterisk: the entity may occur zero, one or several times".to_string()),
751751
(LinkedToken::Plus, "Plus: the entity may occur one or several times".to_string()),
752752
(LinkedToken::QuestionMark, "Question mark: the entity is optional".to_string()),

crates/diff-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version.workspace = true
44
edition.workspace = true
55
authors.workspace = true
66
license.workspace = true
7+
rust-version.workspace = true
78

89
[dependencies]
910
anyhow = "1"
@@ -18,5 +19,4 @@ ansi-to-html = "0.2"
1819
itertools = "0.13"
1920
similar = "2"
2021
regex = "1"
21-
once_cell = "1"
2222
htmldiff = "0.1"

crates/diff-test/src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::fs;
44
use std::fs::File;
55
use std::io::Write;
66
use std::path::Path;
7+
use std::sync::LazyLock;
78

89
use anyhow::{anyhow, Error};
910
use clap::{Args, Parser, Subcommand};
@@ -12,7 +13,6 @@ use ignore::types::TypesBuilder;
1213
use ignore::WalkBuilder;
1314
use itertools::Itertools;
1415
use jsonpath_lib::Compiled;
15-
use once_cell::sync::Lazy;
1616
use prettydiff::diff_words;
1717
use regex::Regex;
1818
use serde_json::Value;
@@ -174,8 +174,10 @@ const IGNORE: &[&str] = &[
174174
"doc.other_translations",
175175
];
176176

177-
static WS_DIFF: Lazy<Regex> = Lazy::new(|| Regex::new(r#"(?<x>>)[\n ]+|[\n ]+(?<y></)"#).unwrap());
178-
static DATA_FLAW_SRC: Lazy<Regex> = Lazy::new(|| Regex::new(r#" data-flaw-src="[^"]+""#).unwrap());
177+
static WS_DIFF: LazyLock<Regex> =
178+
LazyLock::new(|| Regex::new(r#"(?<x>>)[\n ]+|[\n ]+(?<y></)"#).unwrap());
179+
static DATA_FLAW_SRC: LazyLock<Regex> =
180+
LazyLock::new(|| Regex::new(r#" data-flaw-src="[^"]+""#).unwrap());
179181

180182
fn full_diff(lhs: &Value, rhs: &Value, path: &[PathIndex], diff: &mut BTreeMap<String, String>) {
181183
if path.len() == 1 {

crates/rari-data/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version.workspace = true
44
edition.workspace = true
55
authors.workspace = true
66
license.workspace = true
7+
rust-version.workspace = true
78

89
[dependencies]
910
rari-utils = { path = "../rari-utils" }

crates/rari-deps/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ version.workspace = true
44
edition.workspace = true
55
authors.workspace = true
66
license.workspace = true
7+
rust-version.workspace = true
78

89
[dependencies]
910
rari-utils = { path = "../rari-utils" }
10-
once_cell = "1"
1111
thiserror = "1"
1212
serde = { version = "1", features = ["derive"] }
1313
serde_json = { version = "1", features = ["preserve_order"] }

0 commit comments

Comments
 (0)