Remove unused name_str_pair method

This commit is contained in:
Steven Fackler
2014-06-08 00:21:35 -07:00
parent 862cd65dca
commit 9452cd24fb
2 changed files with 0 additions and 22 deletions

View File

@@ -429,17 +429,11 @@ impl attr::AttrMetaMethods for Attribute {
} }
} }
fn meta_item_list<'a>(&'a self) -> Option<&'a [@ast::MetaItem]> { None } fn meta_item_list<'a>(&'a self) -> Option<&'a [@ast::MetaItem]> { None }
fn name_str_pair(&self) -> Option<(InternedString, InternedString)> {
None
}
} }
impl<'a> attr::AttrMetaMethods for &'a Attribute { impl<'a> attr::AttrMetaMethods for &'a Attribute {
fn name(&self) -> InternedString { (**self).name() } fn name(&self) -> InternedString { (**self).name() }
fn value_str(&self) -> Option<InternedString> { (**self).value_str() } fn value_str(&self) -> Option<InternedString> { (**self).value_str() }
fn meta_item_list<'a>(&'a self) -> Option<&'a [@ast::MetaItem]> { None } fn meta_item_list<'a>(&'a self) -> Option<&'a [@ast::MetaItem]> { None }
fn name_str_pair(&self) -> Option<(InternedString, InternedString)> {
None
}
} }
#[deriving(Clone, Encodable, Decodable)] #[deriving(Clone, Encodable, Decodable)]

View File

@@ -53,12 +53,6 @@ pub trait AttrMetaMethods {
fn value_str(&self) -> Option<InternedString>; fn value_str(&self) -> Option<InternedString>;
/// Gets a list of inner meta items from a list MetaItem type. /// Gets a list of inner meta items from a list MetaItem type.
fn meta_item_list<'a>(&'a self) -> Option<&'a [@MetaItem]>; fn meta_item_list<'a>(&'a self) -> Option<&'a [@MetaItem]>;
/**
* If the meta item is a name-value type with a string value then returns
* a tuple containing the name and string value, otherwise `None`
*/
fn name_str_pair(&self) -> Option<(InternedString,InternedString)>;
} }
impl AttrMetaMethods for Attribute { impl AttrMetaMethods for Attribute {
@@ -76,9 +70,6 @@ impl AttrMetaMethods for Attribute {
fn meta_item_list<'a>(&'a self) -> Option<&'a [@MetaItem]> { fn meta_item_list<'a>(&'a self) -> Option<&'a [@MetaItem]> {
self.node.value.meta_item_list() self.node.value.meta_item_list()
} }
fn name_str_pair(&self) -> Option<(InternedString,InternedString)> {
self.meta().name_str_pair()
}
} }
impl AttrMetaMethods for MetaItem { impl AttrMetaMethods for MetaItem {
@@ -108,10 +99,6 @@ impl AttrMetaMethods for MetaItem {
_ => None _ => None
} }
} }
fn name_str_pair(&self) -> Option<(InternedString,InternedString)> {
self.value_str().map(|s| (self.name(), s))
}
} }
// Annoying, but required to get test_cfg to work // Annoying, but required to get test_cfg to work
@@ -121,9 +108,6 @@ impl AttrMetaMethods for @MetaItem {
fn meta_item_list<'a>(&'a self) -> Option<&'a [@MetaItem]> { fn meta_item_list<'a>(&'a self) -> Option<&'a [@MetaItem]> {
(**self).meta_item_list() (**self).meta_item_list()
} }
fn name_str_pair(&self) -> Option<(InternedString,InternedString)> {
(**self).name_str_pair()
}
} }