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

@ -160,7 +160,7 @@ impl<'ln> LayoutNode<'ln> {
/// Returns the interior of this node as a `LayoutJS`. This is highly unsafe for layout to
/// call and as such is marked `unsafe`.
unsafe fn get_jsmanaged<'a>(&'a self) -> &'a LayoutJS<Node> {
unsafe fn get_jsmanaged(&self) -> &LayoutJS<Node> {
&self.node
}
@ -280,7 +280,7 @@ impl<'ln> LayoutNode<'ln> {
/// Borrows the layout data immutably. Fails on a conflicting borrow.
#[inline(always)]
pub fn borrow_layout_data<'a>(&'a self) -> Ref<'a, Option<LayoutDataWrapper>> {
pub fn borrow_layout_data(&self) -> Ref<Option<LayoutDataWrapper>> {
unsafe {
mem::transmute(self.get_jsmanaged().layout_data())
}
@ -288,7 +288,7 @@ impl<'ln> LayoutNode<'ln> {
/// Borrows the layout data mutably. Fails on a conflicting borrow.
#[inline(always)]
pub fn mutate_layout_data<'a>(&'a self) -> RefMut<'a, Option<LayoutDataWrapper>> {
pub fn mutate_layout_data(&self) -> RefMut<Option<LayoutDataWrapper>> {
unsafe {
mem::transmute(self.get_jsmanaged().layout_data_mut())
}
@ -431,12 +431,12 @@ impl<'le> ::selectors::Element for LayoutElement<'le> {
}
#[inline]
fn get_local_name<'a>(&'a self) -> &'a Atom {
fn get_local_name(&self) -> &Atom {
self.element.local_name()
}
#[inline]
fn get_namespace<'a>(&'a self) -> &'a Namespace {
fn get_namespace(&self) -> &Namespace {
self.element.namespace()
}
@ -666,7 +666,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
/// Returns the interior of this node as a `LayoutJS`. This is highly unsafe for layout to
/// call and as such is marked `unsafe`.
unsafe fn get_jsmanaged<'a>(&'a self) -> &'a LayoutJS<Node> {
unsafe fn get_jsmanaged(&self) -> &LayoutJS<Node> {
self.node.get_jsmanaged()
}
@ -739,7 +739,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
/// Borrows the layout data without checking.
#[inline(always)]
fn borrow_layout_data_unchecked<'a>(&'a self) -> *const Option<LayoutDataWrapper> {
fn borrow_layout_data_unchecked(&self) -> *const Option<LayoutDataWrapper> {
unsafe {
self.node.borrow_layout_data_unchecked()
}
@ -749,7 +749,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
///
/// TODO(pcwalton): Make this private. It will let us avoid borrow flag checks in some cases.
#[inline(always)]
pub fn borrow_layout_data<'a>(&'a self) -> Ref<'a, Option<LayoutDataWrapper>> {
pub fn borrow_layout_data(&self) -> Ref<Option<LayoutDataWrapper>> {
self.node.borrow_layout_data()
}
@ -757,14 +757,14 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
///
/// TODO(pcwalton): Make this private. It will let us avoid borrow flag checks in some cases.
#[inline(always)]
pub fn mutate_layout_data<'a>(&'a self) -> RefMut<'a, Option<LayoutDataWrapper>> {
pub fn mutate_layout_data(&self) -> RefMut<Option<LayoutDataWrapper>> {
self.node.mutate_layout_data()
}
/// Returns the style results for the given node. If CSS selector matching
/// has not yet been performed, fails.
#[inline]
pub fn style<'a>(&'a self) -> Ref<'a, Arc<ComputedValues>> {
pub fn style(&self) -> Ref<Arc<ComputedValues>> {
Ref::map(self.borrow_layout_data(), |layout_data_ref| {
let layout_data = layout_data_ref.as_ref().expect("no layout data");
let style = match self.get_pseudo_element_type() {
@ -1000,8 +1000,8 @@ pub struct ThreadSafeLayoutNodeChildrenIterator<'a> {
impl<'a> ThreadSafeLayoutNodeChildrenIterator<'a> {
fn new(parent: ThreadSafeLayoutNode<'a>) -> ThreadSafeLayoutNodeChildrenIterator<'a> {
fn first_child<'a>(parent: ThreadSafeLayoutNode<'a>)
-> Option<ThreadSafeLayoutNode<'a>> {
fn first_child(parent: ThreadSafeLayoutNode)
-> Option<ThreadSafeLayoutNode> {
if parent.pseudo != PseudoElementType::Normal {
return None
}