diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-06-10 22:59:33 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-06-14 07:40:30 +0000 |
| commit | 683e480ffe0ea355d038b4e9c0efeb9c1475a2d3 (patch) | |
| tree | a7c351646c6bf89fa99704a9cc97d882f8163ee3 /src/libsyntax/attr.rs | |
| parent | 5bf7970ac70b4e7781e7b2f3816720aa62fac6fd (diff) | |
| download | rust-683e480ffe0ea355d038b4e9c0efeb9c1475a2d3.tar.gz rust-683e480ffe0ea355d038b4e9c0efeb9c1475a2d3.zip | |
Refactor away `WithAttrs` trait
Diffstat (limited to 'src/libsyntax/attr.rs')
| -rw-r--r-- | src/libsyntax/attr.rs | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index c3c3deea187..8a2b0a0d4d6 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -889,21 +889,6 @@ pub trait HasAttrs: Sized { fn map_attrs<F: FnOnce(Vec<ast::Attribute>) -> Vec<ast::Attribute>>(self, f: F) -> Self; } -/// A cheap way to add Attributes to an AST node. -pub trait WithAttrs { - // FIXME: Could be extended to anything IntoIter<Item=Attribute> - fn with_attrs(self, attrs: ThinAttributes) -> Self; -} - -impl<T: HasAttrs> WithAttrs for T { - fn with_attrs(self, attrs: ThinAttributes) -> Self { - self.map_attrs(|mut orig_attrs| { - orig_attrs.extend(attrs.into_attr_vec()); - orig_attrs - }) - } -} - impl HasAttrs for Vec<Attribute> { fn attrs(&self) -> &[Attribute] { &self |
