Skip to content

Commit

Permalink
wip clean: replace once_cell::Lazy by std LazyLock
Browse files Browse the repository at this point in the history
this allow to remove once_cell dependency.
Warning: Need at least rust 1.80
  • Loading branch information
gwen-lg committed Sep 14, 2024
1 parent a6c1534 commit 8ee5583
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ image = { version = "0.25", default-features = false, features = ["png"] }
iter_fixed = "0.4"
log = "0.4"
nom = "7.1"
once_cell = "1.19"
profiling = "1.0"
regex = "1.10"
thiserror = "1.0"
Expand Down
5 changes: 3 additions & 2 deletions src/vobsub/idx.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! Parse a file in `*.idx` format.
use log::trace;
use once_cell::sync::Lazy;
use regex::Regex;
use std::{
fs,
io::{self, prelude::*, BufReader},
path::Path,
sync::LazyLock,
};

use super::{palette, sub, IResultExt, Palette, VobSubError};
Expand Down Expand Up @@ -90,7 +90,8 @@ where
T: std::io::Read,
Err: Fn(io::Error) -> VobSubError,
{
static KEY_VALUE: Lazy<Regex> = Lazy::new(|| Regex::new("^([A-Za-z/ ]+): (.*)").unwrap());
static KEY_VALUE: LazyLock<Regex> =
LazyLock::new(|| Regex::new("^([A-Za-z/ ]+): (.*)").unwrap());

let mut palette_val: Option<Palette> = None;
let mut buf = String::with_capacity(256);
Expand Down

0 comments on commit 8ee5583

Please sign in to comment.