https://pantsbuild.org/ logo
#development
Title
# development
f

full-kilobyte-93429

03/20/2017, 6:05 PM
still not having a good handle on the closure thing, so i am getting
Copy code
error: borrowed value does not live long enough
   --> src/rust/engine/src/nodes.rs:674:23
    |
674 |     let field_name = &self.selector.field.to_owned();
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ does not live long enough
...
684 |   }
    |   - temporary value only lives until here
    |
    = note: borrowed value must be valid for the static lifetime...

error: aborting due to previous error
for
Copy code
fn expand_transitive(&self, context: &Context, address: &Value) -> NodeFuture<(Value, Value, Vec<Value>)> {
    let address = address.clone();
    let dep_subject_key = externs::key_for(&address);
    let field_name = &self.selector.field.to_owned();
    context
      .get(
        Select::new(self.selector.product.clone(), dep_subject_key, self.variants.clone())
      )
      .map(move |hydrated_target| {
        let deps = externs::project_multi(&hydrated_target, field_name); // only works for "dependencies"
        (address, hydrated_target, deps)
      })
      .boxed()