title: How do I capture a closure in another closure?
body: <pre><code>type Time = f32;
  type Behaviour&lt;'a,T&gt; = |Time|: 'a -&gt; T;
  
  fn map_one&lt;'a,T,R&gt;(f: |T| -&gt; R
                    ,b: Behaviour&lt;'a,T&gt;)
                    -&gt;  Behaviour&lt;'a,R&gt;{
    |time| -&gt; R {
        f(b(time))
    }
  }
  </code></pre>
  
  <p>Err:</p>
  
  <pre><code>&lt;anon&gt;:8:9: 8:10 error: captured variable `b` does not outlive the enclosing closure
  &lt;anon&gt;:8       f(b(time))
                   ^
  &lt;anon&gt;:6:38: 10:2 note: captured variable is valid for the block at 6:37
  &lt;anon&gt;:6                   -&gt;  Behaviour&lt;'a,R&gt;{
  &lt;anon&gt;:7   |time|  -&gt; R {
  &lt;anon&gt;:8       f(b(time))
  &lt;anon&gt;:9   }
  &lt;anon&gt;:10 }
  </code></pre>
  
  <p>I think the error means that the life time of 'a expires when I try to move <code>b</code> into another closure.</p>
  
  <p>How would I express something like this?</p>