@@ -19,11 +19,15 @@ const CODE_UNAVAILABLE: u32 = CODE_PREFIX | 1;
19
19
20
20
/// An unknown error.
21
21
pub const UNKNOWN : Error = Error ( unsafe {
22
+ ///
23
+ /// This is the following constant: 57F40000 (hex) / 1475608576 (decimal).
22
24
NonZeroU32 :: new_unchecked ( CODE_UNKNOWN )
23
25
} ) ;
24
26
25
27
/// No generator is available.
26
28
pub const UNAVAILABLE : Error = Error ( unsafe {
29
+ ///
30
+ /// This is the following constant: 57F40001 (hex) / 1475608577 (decimal).
27
31
NonZeroU32 :: new_unchecked ( CODE_UNAVAILABLE )
28
32
} ) ;
29
33
@@ -61,7 +65,7 @@ impl fmt::Debug for Error {
61
65
fn fmt ( & self , f : & mut fmt:: Formatter ) -> Result < ( ) , fmt:: Error > {
62
66
match self . msg ( ) {
63
67
Some ( msg) => write ! ( f, "Error(\" {}\" )" , msg) ,
64
- None => write ! ( f, "Error({})" , self . 0 . get ( ) ) ,
68
+ None => write ! ( f, "Error({:08X })" , self . 0 ) ,
65
69
}
66
70
}
67
71
}
@@ -70,7 +74,7 @@ impl fmt::Display for Error {
70
74
fn fmt ( & self , f : & mut fmt:: Formatter ) -> Result < ( ) , fmt:: Error > {
71
75
match self . msg ( ) {
72
76
Some ( msg) => write ! ( f, "{}" , msg) ,
73
- None => write ! ( f, "getrandom: unknown code {}" , self . 0 . get ( ) ) ,
77
+ None => write ! ( f, "getrandom: unknown code {:08X }" , self . 0 ) ,
74
78
}
75
79
}
76
80
}
0 commit comments