mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add a few inline directives in rustc_serialize.
This commit is contained in:
@@ -20,6 +20,7 @@ macro_rules! impl_debug_strict_add {
|
||||
($( $ty:ty )*) => {
|
||||
$(
|
||||
impl DebugStrictAdd for $ty {
|
||||
#[inline]
|
||||
fn debug_strict_add(self, other: Self) -> Self {
|
||||
if cfg!(debug_assertions) {
|
||||
self + other
|
||||
@@ -42,6 +43,7 @@ macro_rules! impl_debug_strict_sub {
|
||||
($( $ty:ty )*) => {
|
||||
$(
|
||||
impl DebugStrictSub for $ty {
|
||||
#[inline]
|
||||
fn debug_strict_sub(self, other: Self) -> Self {
|
||||
if cfg!(debug_assertions) {
|
||||
self - other
|
||||
|
||||
@@ -89,10 +89,12 @@ pub fn flush(&mut self) {
|
||||
self.buffered = 0;
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn file(&self) -> &File {
|
||||
&self.file
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn path(&self) -> &Path {
|
||||
&self.path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user