Problem:

```rust pub struct Foo { ... }

impl Foo { fn dosomething(&mut self, ...){ //FIXME: avoid allocation. can't fix this because T is lifetime-bound. let mut guards: Vec> = Vec::withcapacity(xxx.len()); ... } } ```

Solution:

```rust use tmp_vec::TmpVec;

pub struct Foo { tmp_guards: TmpVec>, ... }

impl Foo { fn dosomething(&mut self, ...){ let mut guards = self.tmpguards.borrow_mut(); ... } }

```