From 97dad04178e1db12ed3e6e8869cbecd52844f1fe Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 23 Jan 2017 16:45:03 -0800 Subject: [PATCH] Accept references to trait objects --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index bf4cc9b..791950c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,12 +9,12 @@ use std::{io, mem, ptr, slice}; #[inline] -pub fn write(wr: &mut W, value: V) -> io::Result<()> { +pub fn write(wr: &mut W, value: V) -> io::Result<()> { value.write(wr) } pub trait Integer { - fn write(self, &mut W) -> io::Result<()>; + fn write(self, &mut W) -> io::Result<()>; } const DEC_DIGITS_LUT: &'static[u8] = @@ -30,7 +30,7 @@ macro_rules! impl_Integer { ($($t:ident),* as $conv_fn:ident) => ($( impl Integer for $t { #[allow(unused_comparisons)] - fn write(self, wr: &mut W) -> io::Result<()> { + fn write(self, wr: &mut W) -> io::Result<()> { let is_nonnegative = self >= 0; let mut n = if is_nonnegative { self as $conv_fn