Remove unnecessary inlines

This commit is contained in:
Erick Tryzelaar 2015-03-05 07:35:55 -08:00
parent e7ce710da5
commit 1b632cea9c

View File

@ -41,10 +41,8 @@ impl<Iter: Iterator<Item=u8>> Deserializer<Iter> {
fn eof(&self) -> bool { self.ch.is_none() } fn eof(&self) -> bool { self.ch.is_none() }
#[inline]
fn ch_or_null(&self) -> u8 { self.ch.unwrap_or(b'\x00') } fn ch_or_null(&self) -> u8 { self.ch.unwrap_or(b'\x00') }
#[inline]
fn bump(&mut self) { fn bump(&mut self) {
self.ch = self.rdr.next(); self.ch = self.rdr.next();
@ -56,23 +54,19 @@ impl<Iter: Iterator<Item=u8>> Deserializer<Iter> {
} }
} }
#[inline]
fn next_char(&mut self) -> Option<u8> { fn next_char(&mut self) -> Option<u8> {
self.bump(); self.bump();
self.ch self.ch
} }
#[inline]
fn ch_is(&self, c: u8) -> bool { fn ch_is(&self, c: u8) -> bool {
self.ch == Some(c) self.ch == Some(c)
} }
#[inline]
fn error(&mut self, reason: ErrorCode) -> Error { fn error(&mut self, reason: ErrorCode) -> Error {
Error::SyntaxError(reason, self.line, self.col) Error::SyntaxError(reason, self.line, self.col)
} }
#[inline]
fn parse_whitespace(&mut self) { fn parse_whitespace(&mut self) {
while self.ch_is(b' ') || while self.ch_is(b' ') ||
self.ch_is(b'\n') || self.ch_is(b'\n') ||
@ -80,7 +74,6 @@ impl<Iter: Iterator<Item=u8>> Deserializer<Iter> {
self.ch_is(b'\r') { self.bump(); } self.ch_is(b'\r') { self.bump(); }
} }
#[inline]
fn parse_value<V>(&mut self, mut visitor: V) -> Result<V::Value, Error> fn parse_value<V>(&mut self, mut visitor: V) -> Result<V::Value, Error>
where V: de::Visitor, where V: de::Visitor,
{ {
@ -129,7 +122,6 @@ impl<Iter: Iterator<Item=u8>> Deserializer<Iter> {
} }
} }
#[inline]
fn parse_ident(&mut self, ident: &[u8]) -> Result<(), Error> { fn parse_ident(&mut self, ident: &[u8]) -> Result<(), Error> {
if ident.iter().all(|c| Some(*c) == self.next_char()) { if ident.iter().all(|c| Some(*c) == self.next_char()) {
self.bump(); self.bump();
@ -139,7 +131,6 @@ impl<Iter: Iterator<Item=u8>> Deserializer<Iter> {
} }
} }
#[inline]
fn parse_number<V>(&mut self, mut visitor: V) -> Result<V::Value, Error> fn parse_number<V>(&mut self, mut visitor: V) -> Result<V::Value, Error>
where V: de::Visitor, where V: de::Visitor,
{ {
@ -170,7 +161,6 @@ impl<Iter: Iterator<Item=u8>> Deserializer<Iter> {
} }
} }
#[inline]
fn parse_integer(&mut self) -> Result<i64, Error> { fn parse_integer(&mut self) -> Result<i64, Error> {
let mut res = 0; let mut res = 0;
@ -204,7 +194,6 @@ impl<Iter: Iterator<Item=u8>> Deserializer<Iter> {
Ok(res) Ok(res)
} }
#[inline]
fn parse_decimal(&mut self, res: f64) -> Result<f64, Error> { fn parse_decimal(&mut self, res: f64) -> Result<f64, Error> {
self.bump(); self.bump();
@ -230,7 +219,6 @@ impl<Iter: Iterator<Item=u8>> Deserializer<Iter> {
Ok(res) Ok(res)
} }
#[inline]
fn parse_exponent(&mut self, mut res: f64) -> Result<f64, Error> { fn parse_exponent(&mut self, mut res: f64) -> Result<f64, Error> {
self.bump(); self.bump();
@ -271,7 +259,6 @@ impl<Iter: Iterator<Item=u8>> Deserializer<Iter> {
Ok(res) Ok(res)
} }
#[inline]
fn decode_hex_escape(&mut self) -> Result<u16, Error> { fn decode_hex_escape(&mut self) -> Result<u16, Error> {
let mut i = 0; let mut i = 0;
let mut n = 0u16; let mut n = 0u16;
@ -299,7 +286,6 @@ impl<Iter: Iterator<Item=u8>> Deserializer<Iter> {
Ok(n) Ok(n)
} }
#[inline]
fn parse_string(&mut self) -> Result<(), Error> { fn parse_string(&mut self) -> Result<(), Error> {
self.buf.clear(); self.buf.clear();