@@ -40,6 +40,7 @@ macro_rules! pred {
40
40
}
41
41
42
42
use std:: collections:: { BTreeSet , HashMap , HashSet } ;
43
+ use std:: sync:: LazyLock ;
43
44
44
45
pub use argument_names:: { ARGUMENT_NAMES_MULTIPLE_SLICE , ARGUMENT_NAMES_NOT_SLICE , ARGUMENT_NAMES_USERDATA } ;
45
46
pub use argument_override:: {
@@ -64,7 +65,6 @@ pub use implemented::{
64
65
IMPLEMENTED_CONST_GENERICS , IMPLEMENTED_FUNCTION_LIKE_MACROS , IMPLEMENTED_GENERICS , IMPLEMENTED_MANUAL_DEBUG ,
65
66
IMPLEMENTED_SYSTEM_CLASSES ,
66
67
} ;
67
- use once_cell:: sync:: Lazy ;
68
68
pub use property_tweaks:: { property_tweaks_factory, PropertyReadWrite , PropertyTweak , PropertyTweaks } ;
69
69
70
70
use crate :: func:: { FuncMatcher , UsageTracker } ;
@@ -179,7 +179,7 @@ impl Settings {
179
179
/// map of reserved Rust keywords and their replacement to be used in var, function and class names
180
180
/// key: reserved keyword
181
181
/// value: replacement
182
- pub static RESERVED_RENAME : Lazy < HashMap < & str , & str > > = Lazy :: new ( || {
182
+ pub static RESERVED_RENAME : LazyLock < HashMap < & str , & str > > = LazyLock :: new ( || {
183
183
HashMap :: from ( [
184
184
( "box" , "box_" ) ,
185
185
( "fn" , "fn_" ) ,
@@ -197,7 +197,7 @@ pub static RESERVED_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| {
197
197
} ) ;
198
198
199
199
/// 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 ( || {
201
201
HashMap :: from ( [
202
202
( "size_t" , ( "size_t" , "size_t" ) ) ,
203
203
( "ptrdiff_t" , ( "ptrdiff_t" , "ptrdiff_t" ) ) ,
@@ -216,11 +216,11 @@ pub static PRIMITIVE_TYPEDEFS: Lazy<HashMap<&str, (&str, &str)>> = Lazy::new(||
216
216
] )
217
217
} ) ;
218
218
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" ] ) ) ;
220
220
221
221
/// Types that can be used as `Mat` element
222
222
/// cpp_name(Reference)
223
- pub static DATA_TYPES : Lazy < HashSet < & str > > = Lazy :: new ( || {
223
+ pub static DATA_TYPES : LazyLock < HashSet < & str > > = LazyLock :: new ( || {
224
224
HashSet :: from ( [
225
225
"unsigned char" ,
226
226
"char" ,
@@ -249,39 +249,40 @@ pub static DATA_TYPES: Lazy<HashSet<&str>> = Lazy::new(|| {
249
249
250
250
/// Types that can be used as `Mat` element since OpenCV 5.0
251
251
/// 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" ] ) ) ;
254
254
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
+ } ) ;
283
284
284
- pub static PREVENT_VECTOR_TYPEDEF_GENERATION : Lazy < HashSet < & str > > = Lazy :: new ( || {
285
+ pub static PREVENT_VECTOR_TYPEDEF_GENERATION : LazyLock < HashSet < & str > > = LazyLock :: new ( || {
285
286
HashSet :: from ( [
286
287
// `MatShape` is an alias to `Vector<i32>` and this leads to duplication of definition for the `Vector<Vector<i32>>` type
287
288
"cv::dnn::MatShape" ,
0 commit comments