change to using once_cell for lazy init

This commit is contained in:
Henry Schimke
2023-01-05 10:53:55 -06:00
parent d2a4b21808
commit 20764559ae
37 changed files with 556 additions and 608 deletions

View File

@@ -34,7 +34,7 @@ const LF: &str = "10000110010";
use std::collections::HashMap;
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use crate::{
common::{BitMatrix, BitMatrixTestCase},
@@ -43,9 +43,8 @@ use crate::{
};
use super::Code128Writer;
lazy_static! {
static ref WRITER: Code128Writer = Code128Writer::default();
}
static WRITER: Lazy<Code128Writer> = Lazy::new(|| Code128Writer::default());
#[test]
fn testEncodeWithFunc3() {