Skip to content

Commit 16cdfc9

Browse files
committed
refactor: remove macros
1 parent e23da70 commit 16cdfc9

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/lib.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@ where
101101
}
102102
}
103103

104-
macro_rules! invalid_data {
105-
() => {
106-
return Err(ErrorKind::InvalidData.into())
107-
};
108-
}
109-
110104
impl<T> Read for StripComments<T>
111105
where
112106
T: Read,
@@ -116,7 +110,7 @@ where
116110
if count > 0 {
117111
strip_buf(&mut self.state, &mut buf[..count], self.settings, false)?;
118112
} else if self.state != Top && self.state != InLineComment {
119-
invalid_data!();
113+
return Err(ErrorKind::InvalidData.into());
120114
}
121115
Ok(count)
122116
}
@@ -383,9 +377,7 @@ fn in_comment(c: &mut u8, settings: CommentSettings) -> Result<State> {
383377
let new_state = match c {
384378
b'*' if settings.block_comments => InBlockComment,
385379
b'/' if settings.slash_line_comments => InLineComment,
386-
_ => {
387-
invalid_data!()
388-
}
380+
_ => return Err(ErrorKind::InvalidData.into()),
389381
};
390382
*c = b' ';
391383
Ok(new_state)

0 commit comments

Comments
 (0)