@@ -375,12 +375,12 @@ pub enum blaze_normalize_reason {
375
375
376
376
impl From < Reason > for blaze_normalize_reason {
377
377
fn from ( reason : Reason ) -> Self {
378
+ use blaze_normalize_reason:: * ;
379
+
378
380
match reason {
379
- Reason :: Unmapped => blaze_normalize_reason:: BLAZE_NORMALIZE_REASON_UNMAPPED ,
380
- Reason :: MissingComponent => {
381
- blaze_normalize_reason:: BLAZE_NORMALIZE_REASON_MISSING_COMPONENT
382
- }
383
- Reason :: Unsupported => blaze_normalize_reason:: BLAZE_NORMALIZE_REASON_UNSUPPORTED ,
381
+ Reason :: Unmapped => BLAZE_NORMALIZE_REASON_UNMAPPED ,
382
+ Reason :: MissingComponent => BLAZE_NORMALIZE_REASON_MISSING_COMPONENT ,
383
+ Reason :: Unsupported => BLAZE_NORMALIZE_REASON_UNSUPPORTED ,
384
384
_ => unreachable ! ( ) ,
385
385
}
386
386
}
@@ -390,14 +390,16 @@ impl From<Reason> for blaze_normalize_reason {
390
390
/// Retrieve a textual representation of the reason of a normalization failure.
391
391
#[ no_mangle]
392
392
pub extern "C" fn blaze_normalize_reason_str ( err : blaze_normalize_reason ) -> * const c_char {
393
+ use blaze_normalize_reason:: * ;
394
+
393
395
match err as i32 {
394
- e if e == blaze_normalize_reason :: BLAZE_NORMALIZE_REASON_UNMAPPED as i32 => {
396
+ e if e == BLAZE_NORMALIZE_REASON_UNMAPPED as i32 => {
395
397
Reason :: Unmapped . as_bytes ( ) . as_ptr ( ) . cast ( )
396
398
}
397
- e if e == blaze_normalize_reason :: BLAZE_NORMALIZE_REASON_MISSING_COMPONENT as i32 => {
399
+ e if e == BLAZE_NORMALIZE_REASON_MISSING_COMPONENT as i32 => {
398
400
Reason :: MissingComponent . as_bytes ( ) . as_ptr ( ) . cast ( )
399
401
}
400
- e if e == blaze_normalize_reason :: BLAZE_NORMALIZE_REASON_UNSUPPORTED as i32 => {
402
+ e if e == BLAZE_NORMALIZE_REASON_UNSUPPORTED as i32 => {
401
403
Reason :: Unsupported . as_bytes ( ) . as_ptr ( ) . cast ( )
402
404
}
403
405
_ => b"unknown reason\0 " . as_ptr ( ) . cast ( ) ,
@@ -805,19 +807,15 @@ mod tests {
805
807
#[ tag( miri) ]
806
808
#[ test]
807
809
fn reason_stringification ( ) {
810
+ use blaze_normalize_reason:: * ;
811
+
808
812
let data = [
809
- (
810
- Reason :: Unmapped ,
811
- blaze_normalize_reason:: BLAZE_NORMALIZE_REASON_UNMAPPED ,
812
- ) ,
813
+ ( Reason :: Unmapped , BLAZE_NORMALIZE_REASON_UNMAPPED ) ,
813
814
(
814
815
Reason :: MissingComponent ,
815
- blaze_normalize_reason:: BLAZE_NORMALIZE_REASON_MISSING_COMPONENT ,
816
- ) ,
817
- (
818
- Reason :: Unsupported ,
819
- blaze_normalize_reason:: BLAZE_NORMALIZE_REASON_UNSUPPORTED ,
816
+ BLAZE_NORMALIZE_REASON_MISSING_COMPONENT ,
820
817
) ,
818
+ ( Reason :: Unsupported , BLAZE_NORMALIZE_REASON_UNSUPPORTED ) ,
821
819
] ;
822
820
823
821
for ( reason, expected) in data {
0 commit comments