REAEME.md - Selector's "map"

This commit is contained in:
freestrings
2019-05-15 18:19:00 +09:00
parent 9d8ab7ae23
commit 5b653ab8a0
6 changed files with 347 additions and 40 deletions

View File

@ -267,7 +267,8 @@ impl Selector {
#[wasm_bindgen(catch)]
pub fn get(&mut self) -> result::Result<JsValue, JsValue> {
JsValue::from_serde(&self.selector.get()).map_err(|e| JsValue::from_str(&e.to_string()))
let v = self.selector.get().map_err(|e| JsValue::from_str(&e.to_string()))?;
JsValue::from_serde(&v).map_err(|e| JsValue::from_str(&e.to_string()))
}
}