Skip to content
Snippets Groups Projects
Commit a7d38e29 authored by Carl Lerche's avatar Carl Lerche
Browse files

Remove extra lifetime sigils

parent 98e0d954
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,7 @@ impl MutBuf for AppendBuf {
}
#[inline]
unsafe fn mut_bytes<'a>(&'a mut self) -> &'a mut [u8] {
unsafe fn mut_bytes(&mut self) -> &mut [u8] {
let wr = self.wr as usize;
let cap = self.cap as usize;
self.mem.mut_bytes_slice(wr, cap)
......
......@@ -133,7 +133,7 @@ impl Buf for ByteBuf {
}
#[inline]
fn bytes<'a>(&'a self) -> &'a [u8] {
fn bytes(&self) -> &[u8] {
unsafe { &self.mem.bytes()[self.pos()..self.lim()] }
}
......@@ -212,7 +212,7 @@ impl MutByteBuf {
cnt
}
pub fn bytes<'a>(&'a self) -> &'a [u8] {
pub fn bytes(&self) -> &[u8] {
unsafe { &self.buf.mem.bytes()[..self.buf.pos()] }
}
}
......@@ -224,9 +224,9 @@ impl MutBuf for MutByteBuf {
unsafe fn advance(&mut self, cnt: usize) {
self.buf.advance(cnt)
}
unsafe fn mut_bytes<'a>(&'a mut self) -> &'a mut [u8] {
}
unsafe fn mut_bytes(&mut self) -> &mut [u8] {
let pos = self.buf.pos();
let lim = self.buf.lim();
&mut self.buf.mem.mut_bytes()[pos..lim]
......
......@@ -201,7 +201,7 @@ pub trait MutBuf {
/// length between 0 and `MutBuf::remaining()`.
///
/// The returned byte slice may represent uninitialized memory.
unsafe fn mut_bytes<'a>(&'a mut self) -> &'a mut [u8];
unsafe fn mut_bytes(&mut self) -> &mut [u8];
fn copy_from<S: Source>(&mut self, src: S) -> usize
where Self: Sized {
......@@ -617,7 +617,7 @@ impl<T: AsMut<[u8]> + AsRef<[u8]>> MutBuf for io::Cursor<T> {
/// length between 0 and `MutBuf::remaining()`.
///
/// The returned byte slice may represent uninitialized memory.
unsafe fn mut_bytes<'a>(&'a mut self) -> &'a mut [u8] {
unsafe fn mut_bytes(&mut self) -> &mut [u8] {
let pos = self.position() as usize;
&mut (self.get_mut().as_mut())[pos..]
}
......
......@@ -41,7 +41,7 @@ impl<T: Buf> Buf for Take<T> {
cmp::min(self.inner.remaining(), self.limit)
}
fn bytes<'a>(&'a self) -> &'a [u8] {
fn bytes(&self) -> &[u8] {
&self.inner.bytes()[..self.limit]
}
......@@ -57,7 +57,7 @@ impl<T: MutBuf> MutBuf for Take<T> {
cmp::min(self.inner.remaining(), self.limit)
}
unsafe fn mut_bytes<'a>(&'a mut self) -> &'a mut [u8] {
unsafe fn mut_bytes(&mut self) -> &mut [u8] {
&mut self.inner.mut_bytes()[..self.limit]
}
......
......@@ -14,6 +14,8 @@ pub use imp::buf::{Buf, MutBuf};
pub use imp::bytes::Bytes;
pub mod buf {
//! Traits, helpers, and type definitions for working with buffers.
pub use imp::buf::{
Source,
Sink,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment