Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbabcock committed Dec 18, 2023
1 parent a0573ac commit cb9b769
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/binary/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ where
self.buf.position()
}

#[inline(always)]
#[inline]
fn next_opt(&mut self) -> (Option<Token>, Option<ReaderError>) {
loop {
let window =
Expand Down Expand Up @@ -209,7 +209,7 @@ where
/// assert_eq!(reader.read().unwrap(), Token::Close);
/// assert!(matches!(reader.read().unwrap_err().kind(), ReaderErrorKind::Lexer(LexError::Eof)));
/// ```
#[inline(always)]
#[inline]
pub fn read(&mut self) -> Result<Token, ReaderError> {
// Workaround for borrow checker :(
let s = unsafe { &mut *(self as *mut TokenReader<R>) };
Expand All @@ -233,7 +233,7 @@ where
/// assert_eq!(reader.next().unwrap(), Some(Token::Close));
/// assert_eq!(reader.next().unwrap(), None);
/// ```
#[inline(always)]
#[inline]
pub fn next(&mut self) -> Result<Option<Token>, ReaderError> {
match self.next_opt() {
(Some(x), _) => Ok(Some(x)),
Expand Down
6 changes: 3 additions & 3 deletions src/text/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ where
self.buf.position()
}

#[inline(always)]
#[inline]
unsafe fn next_opt(&mut self) -> (Option<Token>, Option<ReaderError>) {
#[derive(Debug)]
enum ParseState {
Expand Down Expand Up @@ -658,7 +658,7 @@ where
/// assert_eq!(reader.read().unwrap(), Token::Unquoted(Scalar::new(b"1444.11.11")));
/// assert!(matches!(reader.read().unwrap_err().kind(), ReaderErrorKind::Eof));
/// ```
#[inline(always)]
#[inline]
pub fn read(&mut self) -> Result<Token, ReaderError> {
// Workaround for borrow checker :(
let s = unsafe { &mut *(self as *mut TokenReader<R>) };
Expand All @@ -679,7 +679,7 @@ where
/// assert_eq!(reader.read().unwrap(), Token::Unquoted(Scalar::new(b"1444.11.11")));
/// assert_eq!(reader.next().unwrap(), None);
/// ```
#[inline(always)]
#[inline]
pub fn next(&mut self) -> Result<Option<Token>, ReaderError> {
match unsafe { self.next_opt() } {
(Some(x), _) => Ok(Some(x)),
Expand Down

0 comments on commit cb9b769

Please sign in to comment.