Undo elision for trait object; trait objects are strange

This commit is contained in:
Manish Goregaokar 2015-09-04 09:24:49 +05:30
parent e94df1ed5c
commit 5c24da3e2d

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(&self) -> Option<&Flow> {
pub fn front<'a>(&'a self) -> Option<&'a 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(&mut self) -> Option<&mut Flow> {
pub unsafe fn front_mut<'a>(&'a mut self) -> Option<&'a 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(&self) -> Option<&Flow> {
pub fn back<'a>(&'a self) -> Option<&'a 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(&mut self) -> Option<&mut Flow> {
pub unsafe fn back_mut<'a>(&'a mut self) -> Option<&'a mut Flow> {
self.flows.back_mut().map(flow_ref::deref_mut)
}