@@ -21,7 +21,7 @@ use super::{
21
21
22
22
impl < ' a > Input < ' a > for JsonInput {
23
23
/// This is required by since JSON object keys are always strings, I don't think it can be called
24
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
24
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
25
25
fn as_loc_item ( & self ) -> LocItem {
26
26
match self {
27
27
JsonInput :: Int ( i) => ( * i) . into ( ) ,
@@ -102,7 +102,7 @@ impl<'a> Input<'a> for JsonInput {
102
102
_ => Err ( ValError :: new ( ErrorTypeDefaults :: BytesType , self ) ) ,
103
103
}
104
104
}
105
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
105
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
106
106
fn strict_bytes ( & ' a self ) -> ValResult < EitherBytes < ' a > > {
107
107
self . validate_bytes ( false )
108
108
}
@@ -196,7 +196,7 @@ impl<'a> Input<'a> for JsonInput {
196
196
_ => Err ( ValError :: new ( ErrorTypeDefaults :: DictType , self ) ) ,
197
197
}
198
198
}
199
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
199
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
200
200
fn strict_dict ( & ' a self ) -> ValResult < GenericMapping < ' a > > {
201
201
self . validate_dict ( false )
202
202
}
@@ -207,7 +207,7 @@ impl<'a> Input<'a> for JsonInput {
207
207
_ => Err ( ValError :: new ( ErrorTypeDefaults :: ListType , self ) ) ,
208
208
}
209
209
}
210
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
210
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
211
211
fn strict_list ( & ' a self ) -> ValResult < GenericIterable < ' a > > {
212
212
self . validate_list ( false )
213
213
}
@@ -219,7 +219,7 @@ impl<'a> Input<'a> for JsonInput {
219
219
_ => Err ( ValError :: new ( ErrorTypeDefaults :: TupleType , self ) ) ,
220
220
}
221
221
}
222
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
222
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
223
223
fn strict_tuple ( & ' a self ) -> ValResult < GenericIterable < ' a > > {
224
224
self . validate_tuple ( false )
225
225
}
@@ -231,7 +231,7 @@ impl<'a> Input<'a> for JsonInput {
231
231
_ => Err ( ValError :: new ( ErrorTypeDefaults :: SetType , self ) ) ,
232
232
}
233
233
}
234
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
234
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
235
235
fn strict_set ( & ' a self ) -> ValResult < GenericIterable < ' a > > {
236
236
self . validate_set ( false )
237
237
}
@@ -243,7 +243,7 @@ impl<'a> Input<'a> for JsonInput {
243
243
_ => Err ( ValError :: new ( ErrorTypeDefaults :: FrozenSetType , self ) ) ,
244
244
}
245
245
}
246
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
246
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
247
247
fn strict_frozenset ( & ' a self ) -> ValResult < GenericIterable < ' a > > {
248
248
self . validate_frozenset ( false )
249
249
}
@@ -278,7 +278,7 @@ impl<'a> Input<'a> for JsonInput {
278
278
}
279
279
// NO custom `lax_date` implementation, if strict_date fails, the validator will fallback to lax_datetime
280
280
// then check there's no remainder
281
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
281
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
282
282
fn strict_date ( & self ) -> ValResult < EitherDate > {
283
283
self . validate_date ( false )
284
284
}
@@ -365,7 +365,7 @@ impl<'a> Input<'a> for String {
365
365
InputValue :: String ( self )
366
366
}
367
367
368
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
368
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
369
369
fn is_none ( & self ) -> bool {
370
370
false
371
371
}
@@ -374,12 +374,12 @@ impl<'a> Input<'a> for String {
374
374
None
375
375
}
376
376
377
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
377
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
378
378
fn validate_args ( & ' a self ) -> ValResult < ' a , GenericArguments < ' a > > {
379
379
Err ( ValError :: new ( ErrorTypeDefaults :: ArgumentsType , self ) )
380
380
}
381
381
382
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
382
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
383
383
fn validate_dataclass_args ( & ' a self , class_name : & str ) -> ValResult < ' a , GenericArguments < ' a > > {
384
384
let class_name = class_name. to_string ( ) ;
385
385
Err ( ValError :: new (
@@ -405,7 +405,7 @@ impl<'a> Input<'a> for String {
405
405
fn validate_bytes ( & ' a self , _strict : bool ) -> ValResult < EitherBytes < ' a > > {
406
406
Ok ( self . as_bytes ( ) . into ( ) )
407
407
}
408
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
408
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
409
409
fn strict_bytes ( & ' a self ) -> ValResult < EitherBytes < ' a > > {
410
410
self . validate_bytes ( false )
411
411
}
@@ -427,11 +427,11 @@ impl<'a> Input<'a> for String {
427
427
}
428
428
}
429
429
430
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
430
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
431
431
fn ultra_strict_float ( & ' a self ) -> ValResult < EitherFloat < ' a > > {
432
432
self . strict_float ( )
433
433
}
434
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
434
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
435
435
fn strict_float ( & ' a self ) -> ValResult < EitherFloat < ' a > > {
436
436
Err ( ValError :: new ( ErrorTypeDefaults :: FloatType , self ) )
437
437
}
@@ -443,47 +443,47 @@ impl<'a> Input<'a> for String {
443
443
create_decimal ( self . to_object ( py) . into_ref ( py) , self , py)
444
444
}
445
445
446
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
446
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
447
447
fn validate_dict ( & ' a self , _strict : bool ) -> ValResult < GenericMapping < ' a > > {
448
448
Err ( ValError :: new ( ErrorTypeDefaults :: DictType , self ) )
449
449
}
450
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
450
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
451
451
fn strict_dict ( & ' a self ) -> ValResult < GenericMapping < ' a > > {
452
452
self . validate_dict ( false )
453
453
}
454
454
455
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
455
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
456
456
fn validate_list ( & ' a self , _strict : bool ) -> ValResult < GenericIterable < ' a > > {
457
457
Err ( ValError :: new ( ErrorTypeDefaults :: ListType , self ) )
458
458
}
459
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
459
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
460
460
fn strict_list ( & ' a self ) -> ValResult < GenericIterable < ' a > > {
461
461
self . validate_list ( false )
462
462
}
463
463
464
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
464
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
465
465
fn validate_tuple ( & ' a self , _strict : bool ) -> ValResult < GenericIterable < ' a > > {
466
466
Err ( ValError :: new ( ErrorTypeDefaults :: TupleType , self ) )
467
467
}
468
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
468
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
469
469
fn strict_tuple ( & ' a self ) -> ValResult < GenericIterable < ' a > > {
470
470
self . validate_tuple ( false )
471
471
}
472
472
473
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
473
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
474
474
fn validate_set ( & ' a self , _strict : bool ) -> ValResult < GenericIterable < ' a > > {
475
475
Err ( ValError :: new ( ErrorTypeDefaults :: SetType , self ) )
476
476
}
477
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
477
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
478
478
fn strict_set ( & ' a self ) -> ValResult < GenericIterable < ' a > > {
479
479
self . validate_set ( false )
480
480
}
481
481
482
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
482
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
483
483
fn validate_frozenset ( & ' a self , _strict : bool ) -> ValResult < GenericIterable < ' a > > {
484
484
Err ( ValError :: new ( ErrorTypeDefaults :: FrozenSetType , self ) )
485
485
}
486
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
486
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
487
487
fn strict_frozenset ( & ' a self ) -> ValResult < GenericIterable < ' a > > {
488
488
self . validate_frozenset ( false )
489
489
}
@@ -499,7 +499,7 @@ impl<'a> Input<'a> for String {
499
499
fn validate_date ( & self , _strict : bool ) -> ValResult < EitherDate > {
500
500
bytes_as_date ( self , self . as_bytes ( ) )
501
501
}
502
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
502
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
503
503
fn strict_date ( & self ) -> ValResult < EitherDate > {
504
504
self . validate_date ( false )
505
505
}
@@ -511,7 +511,7 @@ impl<'a> Input<'a> for String {
511
511
) -> ValResult < EitherTime > {
512
512
bytes_as_time ( self , self . as_bytes ( ) , microseconds_overflow_behavior)
513
513
}
514
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
514
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
515
515
fn strict_time (
516
516
& self ,
517
517
microseconds_overflow_behavior : speedate:: MicrosecondsPrecisionOverflowBehavior ,
@@ -526,7 +526,7 @@ impl<'a> Input<'a> for String {
526
526
) -> ValResult < EitherDateTime > {
527
527
bytes_as_datetime ( self , self . as_bytes ( ) , microseconds_overflow_behavior)
528
528
}
529
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
529
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
530
530
fn strict_datetime (
531
531
& self ,
532
532
microseconds_overflow_behavior : speedate:: MicrosecondsPrecisionOverflowBehavior ,
@@ -541,7 +541,7 @@ impl<'a> Input<'a> for String {
541
541
) -> ValResult < EitherTimedelta > {
542
542
bytes_as_timedelta ( self , self . as_bytes ( ) , microseconds_overflow_behavior)
543
543
}
544
- #[ cfg_attr( has_no_coverage , no_coverage ) ]
544
+ #[ cfg_attr( has_coverage_attribute , coverage ( off ) ) ]
545
545
fn strict_timedelta (
546
546
& self ,
547
547
microseconds_overflow_behavior : speedate:: MicrosecondsPrecisionOverflowBehavior ,
0 commit comments