diff options
| author | Steven Fackler <sfackler@gmail.com> | 2014-02-13 22:57:43 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-14 07:48:00 -0800 |
| commit | 07ea23e15dab673a3016d21b601234b296e59e57 (patch) | |
| tree | 20d962e6a3b84c9149b9ff9c026aaa2d13421f3f /src/libsyntax/util | |
| parent | c1fac653962d28425134a4f1ec89d1ebea647cf3 (diff) | |
| download | rust-07ea23e15dab673a3016d21b601234b296e59e57.tar.gz rust-07ea23e15dab673a3016d21b601234b296e59e57.zip | |
Expand ItemDecorator extensions in all contexts
Now that fold_item can return multiple items, this is pretty trivial. It also recursively expands generated items so ItemDecorators can generate items that are tagged with ItemDecorators! Closes #4913
Diffstat (limited to 'src/libsyntax/util')
| -rw-r--r-- | src/libsyntax/util/small_vector.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs index e0d7fdd8790..32e5b83ee04 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -64,6 +64,12 @@ impl<T> SmallVector<T> { } } + pub fn push_all(&mut self, other: SmallVector<T>) { + for v in other.move_iter() { + self.push(v); + } + } + pub fn get<'a>(&'a self, idx: uint) -> &'a T { match *self { One(ref v) if idx == 0 => v, |
