update
This commit is contained in:
+6
-6
@@ -5,7 +5,7 @@ extern crate napi_derive;
|
||||
|
||||
use std::convert::TryInto;
|
||||
|
||||
use napi::{CallContext, Env, JsNumber, JsObject, JsString, Module, Result, Task};
|
||||
use napi::{CallContext, JsObject, JsString, Module, Result};
|
||||
|
||||
mod mdiff;
|
||||
|
||||
@@ -35,12 +35,12 @@ fn diff_char(ctx: CallContext) -> Result<JsObject> {
|
||||
item.set_named_property(
|
||||
"count",
|
||||
ctx.env.create_int64(it.count.try_into().unwrap()).unwrap(),
|
||||
);
|
||||
item.set_named_property("value", ctx.env.create_string(&it.value).unwrap());
|
||||
item.set_named_property("added", ctx.env.get_boolean(it.added).unwrap());
|
||||
item.set_named_property("removed", ctx.env.get_boolean(it.removed).unwrap());
|
||||
)?;
|
||||
item.set_named_property("value", ctx.env.create_string(&it.value).unwrap())?;
|
||||
item.set_named_property("added", ctx.env.get_boolean(it.added).unwrap())?;
|
||||
item.set_named_property("removed", ctx.env.get_boolean(it.removed).unwrap())?;
|
||||
|
||||
obj.set_index(idx, item);
|
||||
obj.set_index(idx, item)?;
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user