@@ -131,7 +131,7 @@ impl<Ref: AsRef<[u8]>> Parser<Ref> {
131
131
/// returned.
132
132
pub fn seek ( & mut self , pos : usize ) -> Result < ( ) , ShortInput > {
133
133
if pos > self . len {
134
- Err ( ShortInput )
134
+ Err ( ShortInput ( ( ) ) )
135
135
} else {
136
136
self . pos = pos;
137
137
Ok ( ( ) )
@@ -143,7 +143,7 @@ impl<Ref: AsRef<[u8]>> Parser<Ref> {
143
143
/// If this would take the parser beyond its end, an error is returned.
144
144
pub fn advance ( & mut self , len : usize ) -> Result < ( ) , ShortInput > {
145
145
if len > self . remaining ( ) {
146
- Err ( ShortInput )
146
+ Err ( ShortInput ( ( ) ) )
147
147
} else {
148
148
self . pos += len;
149
149
Ok ( ( ) )
@@ -160,7 +160,7 @@ impl<Ref: AsRef<[u8]>> Parser<Ref> {
160
160
/// If there aren’t, returns an error.
161
161
pub fn check_len ( & self , len : usize ) -> Result < ( ) , ShortInput > {
162
162
if self . remaining ( ) < len {
163
- Err ( ShortInput )
163
+ Err ( ShortInput ( ( ) ) )
164
164
} else {
165
165
Ok ( ( ) )
166
166
}
@@ -181,7 +181,7 @@ impl<Ref: AsRef<[u8]>> Parser<Ref> {
181
181
{
182
182
let end = self . pos + len;
183
183
if end > self . len {
184
- return Err ( ShortInput ) ;
184
+ return Err ( ShortInput ( ( ) ) ) ;
185
185
}
186
186
let res = self . octets . range ( self . pos , end) ;
187
187
self . pos = end;
@@ -275,8 +275,8 @@ impl<Ref: AsRef<[u8]>> Parser<Ref> {
275
275
//--------- ShortInput -------------------------------------------------------
276
276
277
277
/// An attempt was made to go beyond the end of the parser.
278
- #[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
279
- pub struct ShortInput ;
278
+ #[ derive( Clone , Copy , Debug , Default , Eq , PartialEq ) ]
279
+ pub struct ShortInput ( ( ) ) ;
280
280
281
281
//--- Display and Error
282
282
0 commit comments