File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -101,12 +101,6 @@ where
101
101
}
102
102
}
103
103
104
- macro_rules! invalid_data {
105
- ( ) => {
106
- return Err ( ErrorKind :: InvalidData . into( ) )
107
- } ;
108
- }
109
-
110
104
impl < T > Read for StripComments < T >
111
105
where
112
106
T : Read ,
@@ -116,7 +110,7 @@ where
116
110
if count > 0 {
117
111
strip_buf ( & mut self . state , & mut buf[ ..count] , self . settings , false ) ?;
118
112
} else if self . state != Top && self . state != InLineComment {
119
- invalid_data ! ( ) ;
113
+ return Err ( ErrorKind :: InvalidData . into ( ) ) ;
120
114
}
121
115
Ok ( count)
122
116
}
@@ -383,9 +377,7 @@ fn in_comment(c: &mut u8, settings: CommentSettings) -> Result<State> {
383
377
let new_state = match c {
384
378
b'*' if settings. block_comments => InBlockComment ,
385
379
b'/' if settings. slash_line_comments => InLineComment ,
386
- _ => {
387
- invalid_data ! ( )
388
- }
380
+ _ => return Err ( ErrorKind :: InvalidData . into ( ) ) ,
389
381
} ;
390
382
* c = b' ' ;
391
383
Ok ( new_state)
You can’t perform that action at this time.
0 commit comments