@@ -158,15 +158,15 @@ pub struct Error {
158158 /// Current character
159159 character : Option < char > ,
160160 /// Type of error
161- error : ErrorType ,
161+ err_type : ErrorType ,
162162}
163163
164164impl Error {
165- pub ( crate ) fn new ( index : usize , character : Option < char > , error : ErrorType ) -> Self {
165+ pub ( crate ) fn new ( index : usize , character : Option < char > , err_type : ErrorType ) -> Self {
166166 Self {
167167 index,
168168 character,
169- error ,
169+ err_type ,
170170 }
171171 }
172172 pub ( crate ) fn new_c ( index : usize , character : char , error : ErrorType ) -> Self {
@@ -179,7 +179,7 @@ impl Error {
179179 Self {
180180 index : 0 ,
181181 character : None ,
182- error : t,
182+ err_type : t,
183183 }
184184 }
185185
@@ -198,7 +198,7 @@ impl Error {
198198 /// Returns the type of error that occurred.
199199 #[ must_use]
200200 pub fn error ( & self ) -> & ErrorType {
201- & self . error
201+ & self . err_type
202202 }
203203
204204 // These make it a bit easier to fit into a serde_json context
@@ -209,7 +209,7 @@ impl Error {
209209 #[ must_use]
210210 pub fn is_io ( & self ) -> bool {
211211 // We have to include InternalError _somewhere_
212- match & self . error {
212+ match & self . err_type {
213213 ErrorType :: Io ( _) | ErrorType :: InputTooLarge => true ,
214214 ErrorType :: InternalError ( e) if !matches ! ( e, crate :: InternalError :: TapeError ) => true ,
215215 _ => false ,
@@ -219,7 +219,7 @@ impl Error {
219219 /// Indicates if the error that occurred was an early EOF
220220 #[ must_use]
221221 pub fn is_eof ( & self ) -> bool {
222- matches ! ( self . error , ErrorType :: Eof )
222+ matches ! ( self . err_type , ErrorType :: Eof )
223223 }
224224
225225 /// Indicates if the error that occurred was due to a data shape error
@@ -234,7 +234,7 @@ impl Error {
234234 pub fn is_syntax ( & self ) -> bool {
235235 // Lazy? maybe but if it aint something else...
236236 matches ! (
237- self . error ,
237+ self . err_type ,
238238 ErrorType :: InternalError ( crate :: InternalError :: TapeError ) | //This seems to get thrown on some syntax errors
239239 ErrorType :: BadKeyType |
240240 ErrorType :: ExpectedArrayComma |
@@ -268,9 +268,9 @@ impl std::error::Error for Error {}
268268impl fmt:: Display for Error {
269269 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
270270 if let Some ( c) = self . character {
271- write ! ( f, "{:?} at character {} ('{c}')" , self . error , self . index)
271+ write ! ( f, "{:?} at character {} ('{c}')" , self . err_type , self . index)
272272 } else {
273- write ! ( f, "{:?} at character {}" , self . error , self . index)
273+ write ! ( f, "{:?} at character {}" , self . err_type , self . index)
274274 }
275275 }
276276}
0 commit comments