Elide lifetime that can be inferred

This commit is contained in:
David Tolnay 2019-05-01 19:10:39 -07:00
parent 6b8a090932
commit b2ac3011f7
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
1 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ mod private {
pub trait Integer: private::Sealed { pub trait Integer: private::Sealed {
// Not public API. // Not public API.
#[doc(hidden)] #[doc(hidden)]
fn write<'a>(self, buf: &'a mut Buffer) -> &'a str; fn write(self, buf: &mut Buffer) -> &str;
} }
trait IntegerPrivate<B> { trait IntegerPrivate<B> {
@ -157,7 +157,7 @@ macro_rules! impl_IntegerCommon {
($max_len:expr, $t:ident) => { ($max_len:expr, $t:ident) => {
impl Integer for $t { impl Integer for $t {
#[inline] #[inline]
fn write<'a>(self, buf: &'a mut Buffer) -> &'a str { fn write(self, buf: &mut Buffer) -> &str {
unsafe { unsafe {
debug_assert!($max_len <= I128_MAX_LEN); debug_assert!($max_len <= I128_MAX_LEN);
let buf = mem::transmute::<&mut [u8; I128_MAX_LEN], &mut [u8; $max_len]>( let buf = mem::transmute::<&mut [u8; I128_MAX_LEN], &mut [u8; $max_len]>(