Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
fn from(e: Explode) -> E { match e { } }
}*/
+#[ext(pub)]
+impl JsV {
+ fn set<K: Into<String>>(&mut self, k: K, v: &JsV) {
+ self.as_object_mut().unwrap().insert(k.into(), v.clone());
+ }
+}
+
// -------------------- Substition --------------------
pub trait Substitutor {
let d = d.as_object().unwrap();
p.pos = coord(&d["pos"]);
for (k,v) in d {
- p.info
- .as_object_mut().unwrap()
- .insert(k.to_string(), v.clone());
+ p.info.set(k, &v);
}
},
_ => {