Skip to content

Commit

Permalink
Refine a lifetime parameter on TElement's get_local_name
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Zwarich committed Oct 1, 2014
1 parent e894499 commit ccc5d97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions components/layout/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,12 @@ impl<'le> LayoutElement<'le> {

impl<'le> TElement<'le> for LayoutElement<'le> {
#[inline]
fn get_local_name<'a>(&'a self) -> &'a Atom {
fn get_local_name(&self) -> &'le Atom {
&self.element.local_name
}

#[inline]
fn get_namespace<'a>(&'a self) -> &'a Namespace {
fn get_namespace(&self) -> &'le Namespace {
&self.element.namespace
}

Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ impl<'a> style::TElement<'a> for JSRef<'a, Element> {
_ => None,
}
}
fn get_local_name<'b>(&'b self) -> &'b Atom {
fn get_local_name(&self) -> &'a Atom {
// FIXME(zwarich): Remove this when UFCS lands and there is a better way
// of disambiguating methods.
fn get_local_name<'a, T: ElementHelpers<'a>>(this: T) -> &'a Atom {
Expand All @@ -974,7 +974,7 @@ impl<'a> style::TElement<'a> for JSRef<'a, Element> {

get_local_name(*self)
}
fn get_namespace<'b>(&'b self) -> &'b Namespace {
fn get_namespace(&self) -> &'a Namespace {
// FIXME(zwarich): Remove this when UFCS lands and there is a better way
// of disambiguating methods.
fn get_namespace<'a, T: ElementHelpers<'a>>(this: T) -> &'a Namespace {
Expand Down
4 changes: 2 additions & 2 deletions components/style/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ pub trait TNode<'a, E: TElement<'a>> : Clone {
pub trait TElement<'a> {
fn get_attr(&self, namespace: &Namespace, attr: &str) -> Option<&'a str>;
fn get_link(&self) -> Option<&'a str>;
fn get_local_name<'b>(&'b self) -> &'b Atom;
fn get_namespace<'b>(&'b self) -> &'b Namespace;
fn get_local_name(&self) -> &'a Atom;
fn get_namespace(&self) -> &'a Namespace;
fn get_hover_state(&self) -> bool;
fn get_id(&self) -> Option<Atom>;
fn get_disabled_state(&self) -> bool;
Expand Down

0 comments on commit ccc5d97

Please sign in to comment.