Skip to content

Commit

Permalink
replace lazy_static with once_cell
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Aug 25, 2024
1 parent ec1144e commit a788d73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ terminfo = "0.9.0"

[dev-dependencies]
insta = "1.38.0"
lazy_static = "1.4"
once_cell = "1.19.0"
pretty_assertions = "1"
regex = "1.10.4"
set-git-hooks-dir = "1.0.2"
Expand Down
6 changes: 2 additions & 4 deletions src/syntect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,17 +1100,15 @@ impl<'main, W: WriteOnLocked> Printer for SyntectPrinter<'main, W> {
mod tests {
use super::*;
use crate::chunk::{File, LineMatch};
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use std::cell::{RefCell, RefMut};
use std::fmt;
use std::fs;
use std::mem;
use std::path::PathBuf;
use std::str;

lazy_static! {
static ref ASSETS: SyntectAssets = SyntectAssets::load(None).unwrap();
}
static ASSETS: Lazy<SyntectAssets> = Lazy::new(|| SyntectAssets::load(None).unwrap());

struct DummyStdoutLock<'a>(RefMut<'a, Vec<u8>>);
impl<'a> Write for DummyStdoutLock<'a> {
Expand Down

0 comments on commit a788d73

Please sign in to comment.