44
55use consensus_encoding:: {
66 ArrayDecoder , ArrayEncoder , Decodable , Decoder , Decoder2 , Decoder6 , Encodable , Encoder ,
7- Encoder2 , Encoder6 , UnexpectedEof ,
7+ Encoder2 , Encoder6 , UnexpectedEofError ,
88} ;
99
1010const EMPTY : & [ u8 ] = & [ ] ;
@@ -30,11 +30,11 @@ impl Encodable for CompositeData {
3030/// A unified error type for [`CompositeDataDecoder`].
3131#[ derive( Debug , Clone , PartialEq , Eq ) ]
3232enum CompositeError {
33- Eof ( UnexpectedEof ) ,
33+ Eof ( UnexpectedEofError ) ,
3434}
3535
36- impl From < UnexpectedEof > for CompositeError {
37- fn from ( eof : UnexpectedEof ) -> Self { CompositeError :: Eof ( eof) }
36+ impl From < UnexpectedEofError > for CompositeError {
37+ fn from ( eof : UnexpectedEofError ) -> Self { CompositeError :: Eof ( eof) }
3838}
3939
4040impl core:: fmt:: Display for CompositeError {
@@ -115,7 +115,7 @@ fn composition_nested() {
115115 }
116116 assert_eq ! ( encoded_bytes, data) ;
117117
118- let mut decoder6: Decoder6 < _ , _ , _ , _ , _ , _ , UnexpectedEof > = Decoder6 :: new (
118+ let mut decoder6: Decoder6 < _ , _ , _ , _ , _ , _ , UnexpectedEofError > = Decoder6 :: new (
119119 ArrayDecoder :: < 1 > :: new ( ) ,
120120 ArrayDecoder :: < 1 > :: new ( ) ,
121121 ArrayDecoder :: < 1 > :: new ( ) ,
@@ -139,7 +139,7 @@ fn composition_nested() {
139139#[ test]
140140fn composition_extra_bytes ( ) {
141141 // Test that Decoder2 consumes exactly what it needs and leaves extra bytes unconsumed.
142- let mut decoder2: Decoder2 < _ , _ , UnexpectedEof > =
142+ let mut decoder2: Decoder2 < _ , _ , UnexpectedEofError > =
143143 Decoder2 :: new ( ArrayDecoder :: < 2 > :: new ( ) , ArrayDecoder :: < 3 > :: new ( ) ) ;
144144 let mut bytes = & [ 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 ] [ ..] ;
145145 let original_len = bytes. len ( ) ;
@@ -167,22 +167,22 @@ fn composition_error_unification() {
167167 #[ derive( Debug , Clone , PartialEq , Eq ) ]
168168 enum NestedError {
169169 BadChecksum ,
170- UnexpectedEof ( UnexpectedEof ) ,
170+ UnexpectedEof ( UnexpectedEofError ) ,
171171 }
172172
173- impl From < UnexpectedEof > for NestedError {
174- fn from ( eof : UnexpectedEof ) -> Self { NestedError :: UnexpectedEof ( eof) }
173+ impl From < UnexpectedEofError > for NestedError {
174+ fn from ( eof : UnexpectedEofError ) -> Self { NestedError :: UnexpectedEof ( eof) }
175175 }
176176
177177 /// Error for top level encoder.
178178 #[ derive( Debug , Clone , PartialEq , Eq ) ]
179179 enum TopLevelError {
180- UnexpectedEof ( UnexpectedEof ) ,
180+ UnexpectedEof ( UnexpectedEofError ) ,
181181 Validation ( NestedError ) ,
182182 }
183183
184- impl From < UnexpectedEof > for TopLevelError {
185- fn from ( eof : UnexpectedEof ) -> Self { TopLevelError :: UnexpectedEof ( eof) }
184+ impl From < UnexpectedEofError > for TopLevelError {
185+ fn from ( eof : UnexpectedEofError ) -> Self { TopLevelError :: UnexpectedEof ( eof) }
186186 }
187187
188188 impl From < NestedError > for TopLevelError {
0 commit comments