Skip to content

Commit

Permalink
enable rust 2018 in class-factory example
Browse files Browse the repository at this point in the history
  • Loading branch information
theJian committed Sep 4, 2019
1 parent e085b3a commit 8254988
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 104 deletions.
1 change: 1 addition & 0 deletions class-factory/native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "class-factory"
version = "0.1.0"
build = "build.rs"
exclude = ["artifacts.json", "index.node"]
edition = "2018"

[lib]
name = "class_factory"
Expand Down
8 changes: 5 additions & 3 deletions class-factory/native/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ declare_types! {
method log(mut cx) {
let log = cx.argument::<JsString>(0)?;
let this = cx.this();
let guard = cx.lock();
{
let guard = cx.lock();

// Borrow the internal `Logger` and call `log`
this.borrow(&guard).log(&log.value());
// Borrow the internal `Logger` and call `log`
this.borrow(&guard).log(&log.value());
}

Ok(cx.undefined().upcast())
}
Expand Down
Loading

0 comments on commit 8254988

Please sign in to comment.