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

@@ -24,11 +24,9 @@ use crate::{
use super::{decoder::Decoder, detector::Detector};
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
lazy_static! {
static ref DECODER: Decoder = Decoder::new();
}
static DECODER: Lazy<Decoder> = Lazy::new(|| Decoder::new());
/**
* This implementation can detect and decode Data Matrix codes in an image.