Elide most 'a lifetimes

This commit is contained in:
Manish Goregaokar 2015-09-04 08:55:51 +05:30
parent 35dd1816a9
commit 54c036cd66
33 changed files with 126 additions and 126 deletions

View file

@ -25,27 +25,27 @@ pub struct MutFlowListIterator<'a> {
impl FlowList {
/// Provide a reference to the front element, or None if the list is empty
#[inline]
pub fn front<'a>(&'a self) -> Option<&'a Flow> {
pub fn front(&self) -> Option<&Flow> {
self.flows.front().map(|head| &**head)
}
/// Provide a mutable reference to the front element, or None if the list is empty
#[inline]
#[allow(unsafe_code)]
pub unsafe fn front_mut<'a>(&'a mut self) -> Option<&'a mut Flow> {
pub unsafe fn front_mut(&mut self) -> Option<&mut Flow> {
self.flows.front_mut().map(flow_ref::deref_mut)
}
/// Provide a reference to the back element, or None if the list is empty
#[inline]
pub fn back<'a>(&'a self) -> Option<&'a Flow> {
pub fn back(&self) -> Option<&Flow> {
self.flows.back().map(|tail| &**tail)
}
/// Provide a mutable reference to the back element, or None if the list is empty
#[inline]
#[allow(unsafe_code)]
pub unsafe fn back_mut<'a>(&'a mut self) -> Option<&'a mut Flow> {
pub unsafe fn back_mut(&mut self) -> Option<&mut Flow> {
self.flows.back_mut().map(flow_ref::deref_mut)
}
@ -80,7 +80,7 @@ impl FlowList {
/// Provide a forward iterator
#[inline]
pub fn iter<'a>(&'a self) -> FlowListIterator<'a> {
pub fn iter(&self) -> FlowListIterator {
FlowListIterator {
it: self.flows.iter(),
}
@ -88,7 +88,7 @@ impl FlowList {
/// Provide a forward iterator with mutable references
#[inline]
pub fn iter_mut<'a>(&'a mut self) -> MutFlowListIterator<'a> {
pub fn iter_mut(&mut self) -> MutFlowListIterator {
MutFlowListIterator {
it: self.flows.iter_mut(),
}