@@ -40,6 +40,7 @@ macro_rules! pred {
4040}
4141
4242use std:: collections:: { BTreeSet , HashMap , HashSet } ;
43+ use std:: sync:: LazyLock ;
4344
4445pub use argument_names:: { ARGUMENT_NAMES_MULTIPLE_SLICE , ARGUMENT_NAMES_NOT_SLICE , ARGUMENT_NAMES_USERDATA } ;
4546pub use argument_override:: {
@@ -64,7 +65,6 @@ pub use implemented::{
6465 IMPLEMENTED_CONST_GENERICS , IMPLEMENTED_FUNCTION_LIKE_MACROS , IMPLEMENTED_GENERICS , IMPLEMENTED_MANUAL_DEBUG ,
6566 IMPLEMENTED_SYSTEM_CLASSES ,
6667} ;
67- use once_cell:: sync:: Lazy ;
6868pub use property_tweaks:: { property_tweaks_factory, PropertyReadWrite , PropertyTweak , PropertyTweaks } ;
6969
7070use crate :: func:: { FuncMatcher , UsageTracker } ;
@@ -179,7 +179,7 @@ impl Settings {
179179/// map of reserved Rust keywords and their replacement to be used in var, function and class names
180180/// key: reserved keyword
181181/// value: replacement
182- pub static RESERVED_RENAME : Lazy < HashMap < & str , & str > > = Lazy :: new ( || {
182+ pub static RESERVED_RENAME : LazyLock < HashMap < & str , & str > > = LazyLock :: new ( || {
183183 HashMap :: from ( [
184184 ( "box" , "box_" ) ,
185185 ( "fn" , "fn_" ) ,
@@ -197,7 +197,7 @@ pub static RESERVED_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| {
197197} ) ;
198198
199199/// cpp_name(Reference) => ( rust_name(Reference(No)), cpp_name(Reference) )
200- pub static PRIMITIVE_TYPEDEFS : Lazy < HashMap < & str , ( & str , & str ) > > = Lazy :: new ( || {
200+ pub static PRIMITIVE_TYPEDEFS : LazyLock < HashMap < & str , ( & str , & str ) > > = LazyLock :: new ( || {
201201 HashMap :: from ( [
202202 ( "size_t" , ( "size_t" , "size_t" ) ) ,
203203 ( "ptrdiff_t" , ( "ptrdiff_t" , "ptrdiff_t" ) ) ,
@@ -216,11 +216,11 @@ pub static PRIMITIVE_TYPEDEFS: Lazy<HashMap<&str, (&str, &str)>> = Lazy::new(||
216216 ] )
217217} ) ;
218218
219- pub static STATIC_RUST_MODULES : Lazy < BTreeSet < & str > > = Lazy :: new ( || BTreeSet :: from ( [ "core" , "sys" , "types" ] ) ) ;
219+ pub static STATIC_RUST_MODULES : LazyLock < BTreeSet < & str > > = LazyLock :: new ( || BTreeSet :: from ( [ "core" , "sys" , "types" ] ) ) ;
220220
221221/// Types that can be used as `Mat` element
222222/// cpp_name(Reference)
223- pub static DATA_TYPES : Lazy < HashSet < & str > > = Lazy :: new ( || {
223+ pub static DATA_TYPES : LazyLock < HashSet < & str > > = LazyLock :: new ( || {
224224 HashSet :: from ( [
225225 "unsigned char" ,
226226 "char" ,
@@ -249,39 +249,40 @@ pub static DATA_TYPES: Lazy<HashSet<&str>> = Lazy::new(|| {
249249
250250/// Types that can be used as `Mat` element since OpenCV 5.0
251251/// cpp_name(Reference)
252- pub static DATA_TYPES_5_0 : Lazy < HashSet < & str > > =
253- Lazy :: new ( || HashSet :: from ( [ "uint32_t" , "bfloat" , "bfloat16_t" , "uint64_t" , "int64_t" , "bool" ] ) ) ;
252+ pub static DATA_TYPES_5_0 : LazyLock < HashSet < & str > > =
253+ LazyLock :: new ( || HashSet :: from ( [ "uint32_t" , "bfloat" , "bfloat16_t" , "uint64_t" , "int64_t" , "bool" ] ) ) ;
254254
255- pub static NO_SKIP_NAMESPACE_IN_LOCALNAME : Lazy < HashMap < Option < SupportedModule > , HashMap < & str , & str > > > = Lazy :: new ( || {
256- HashMap :: from ( [
257- ( None , HashMap :: from ( [ ( "detail" , "Detail" ) ] ) ) ,
258- ( Some ( SupportedModule :: Calib3d ) , HashMap :: from ( [ ( "fisheye" , "Fisheye" ) ] ) ) ,
259- ( Some ( SupportedModule :: CudaBgSegm ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
260- ( Some ( SupportedModule :: CudaCodec ) , HashMap :: from ( [ ( "cudacodec" , "CUDA" ) ] ) ) ,
261- ( Some ( SupportedModule :: CudaFeatures2d ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
262- ( Some ( SupportedModule :: CudaImgProc ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
263- ( Some ( SupportedModule :: CudaLegacy ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
264- ( Some ( SupportedModule :: CudaObjDetect ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
265- ( Some ( SupportedModule :: CudaOptFlow ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
266- ( Some ( SupportedModule :: CudaStereo ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
267- ( Some ( SupportedModule :: Gapi ) , HashMap :: from ( [ ( "imgproc" , "ImgProc" ) ] ) ) ,
268- ( Some ( SupportedModule :: Mcc ) , HashMap :: from ( [ ( "mcc" , "MCC" ) ] ) ) ,
269- ( Some ( SupportedModule :: Rapid ) , HashMap :: from ( [ ( "rapid" , "Rapid" ) ] ) ) ,
270- (
271- Some ( SupportedModule :: Rgbd ) ,
272- HashMap :: from ( [
273- ( "dynafu" , "Dynafu" ) ,
274- ( "kinfu" , "Kinfu" ) ,
275- ( "colored_kinfu" , "ColoredKinfu" ) ,
276- ( "linemod" , "LineMod" ) ,
277- ] ) ,
278- ) ,
279- ( Some ( SupportedModule :: Stitching ) , HashMap :: from ( [ ( "fisheye" , "Fisheye" ) ] ) ) ,
280- ( Some ( SupportedModule :: SuperRes ) , HashMap :: from ( [ ( "superres" , "SuperRes" ) ] ) ) ,
281- ] )
282- } ) ;
255+ pub static NO_SKIP_NAMESPACE_IN_LOCALNAME : LazyLock < HashMap < Option < SupportedModule > , HashMap < & str , & str > > > =
256+ LazyLock :: new ( || {
257+ HashMap :: from ( [
258+ ( None , HashMap :: from ( [ ( "detail" , "Detail" ) ] ) ) ,
259+ ( Some ( SupportedModule :: Calib3d ) , HashMap :: from ( [ ( "fisheye" , "Fisheye" ) ] ) ) ,
260+ ( Some ( SupportedModule :: CudaBgSegm ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
261+ ( Some ( SupportedModule :: CudaCodec ) , HashMap :: from ( [ ( "cudacodec" , "CUDA" ) ] ) ) ,
262+ ( Some ( SupportedModule :: CudaFeatures2d ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
263+ ( Some ( SupportedModule :: CudaImgProc ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
264+ ( Some ( SupportedModule :: CudaLegacy ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
265+ ( Some ( SupportedModule :: CudaObjDetect ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
266+ ( Some ( SupportedModule :: CudaOptFlow ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
267+ ( Some ( SupportedModule :: CudaStereo ) , HashMap :: from ( [ ( "cuda" , "CUDA" ) ] ) ) ,
268+ ( Some ( SupportedModule :: Gapi ) , HashMap :: from ( [ ( "imgproc" , "ImgProc" ) ] ) ) ,
269+ ( Some ( SupportedModule :: Mcc ) , HashMap :: from ( [ ( "mcc" , "MCC" ) ] ) ) ,
270+ ( Some ( SupportedModule :: Rapid ) , HashMap :: from ( [ ( "rapid" , "Rapid" ) ] ) ) ,
271+ (
272+ Some ( SupportedModule :: Rgbd ) ,
273+ HashMap :: from ( [
274+ ( "dynafu" , "Dynafu" ) ,
275+ ( "kinfu" , "Kinfu" ) ,
276+ ( "colored_kinfu" , "ColoredKinfu" ) ,
277+ ( "linemod" , "LineMod" ) ,
278+ ] ) ,
279+ ) ,
280+ ( Some ( SupportedModule :: Stitching ) , HashMap :: from ( [ ( "fisheye" , "Fisheye" ) ] ) ) ,
281+ ( Some ( SupportedModule :: SuperRes ) , HashMap :: from ( [ ( "superres" , "SuperRes" ) ] ) ) ,
282+ ] )
283+ } ) ;
283284
284- pub static PREVENT_VECTOR_TYPEDEF_GENERATION : Lazy < HashSet < & str > > = Lazy :: new ( || {
285+ pub static PREVENT_VECTOR_TYPEDEF_GENERATION : LazyLock < HashSet < & str > > = LazyLock :: new ( || {
285286 HashSet :: from ( [
286287 // `MatShape` is an alias to `Vector<i32>` and this leads to duplication of definition for the `Vector<Vector<i32>>` type
287288 "cv::dnn::MatShape" ,
0 commit comments