@@ -30,11 +30,9 @@ pub enum DecodeError {
30
30
impl fmt:: Display for DecodeError {
31
31
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
32
32
match * self {
33
- DecodeError :: InvalidByte ( index, byte) => {
34
- write ! ( f, "Invalid byte {}, offset {}." , byte, index)
35
- }
36
- DecodeError :: InvalidLength => write ! ( f, "Encoded text cannot have a 6-bit remainder." ) ,
37
- DecodeError :: InvalidLastSymbol ( index, byte) => {
33
+ Self :: InvalidByte ( index, byte) => write ! ( f, "Invalid byte {}, offset {}." , byte, index) ,
34
+ Self :: InvalidLength => write ! ( f, "Encoded text cannot have a 6-bit remainder." ) ,
35
+ Self :: InvalidLastSymbol ( index, byte) => {
38
36
write ! ( f, "Invalid last symbol {}, offset {}." , byte, index)
39
37
}
40
38
}
@@ -45,9 +43,9 @@ impl fmt::Display for DecodeError {
45
43
impl error:: Error for DecodeError {
46
44
fn description ( & self ) -> & str {
47
45
match * self {
48
- DecodeError :: InvalidByte ( _, _) => "invalid byte" ,
49
- DecodeError :: InvalidLength => "invalid length" ,
50
- DecodeError :: InvalidLastSymbol ( _, _) => "invalid last symbol" ,
46
+ Self :: InvalidByte ( _, _) => "invalid byte" ,
47
+ Self :: InvalidLength => "invalid length" ,
48
+ Self :: InvalidLastSymbol ( _, _) => "invalid last symbol" ,
51
49
}
52
50
}
53
51
0 commit comments