-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
address issue with mutable borrow using get_value_index (#115)
* use get_value_at to look up argument * implement ExtractArgFromJs that uses borrow instead of mut borrow
- Loading branch information
Showing
35 changed files
with
226 additions
and
227 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "node-bindgen" | ||
version = "4.0.1" | ||
version = "4.1.0" | ||
authors = ["Fluvio Contributors <[email protected]>"] | ||
edition = "2018" | ||
description = "easy way to write nodejs module using rust" | ||
|
@@ -16,9 +16,9 @@ build = ["nj-build"] | |
|
||
[dependencies] | ||
nj-sys = { path = "nj-sys", version = "3.0.0", optional = true } | ||
nj-core = { path = "nj-core", version = "4.0.0", optional = true } | ||
nj-core = { path = "nj-core", version = "4.1.0", optional = true } | ||
nj-build = { path = "nj-build", version = "0.2.1", optional = true } | ||
nj-derive = { path = "nj-derive", version = "2.1.1", optional = true} | ||
nj-derive = { path = "nj-derive", version = "3.0.0", optional = true} | ||
|
||
[workspace] | ||
members = [ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,17 @@ | ||
|
||
|
||
use node_bindgen::derive::node_bindgen; | ||
|
||
|
||
|
||
/// create array and fill with increase value | ||
#[node_bindgen] | ||
fn make_array(count: i32) -> Vec<i32> { | ||
|
||
let mut array = vec![]; | ||
for i in 0..count { | ||
array.push(i); | ||
} | ||
array | ||
} | ||
|
||
|
||
/// sum array of values | ||
#[node_bindgen] | ||
fn sum_array(array: Vec<i32>) -> i32 { | ||
|
||
array.iter().sum() | ||
array.iter().sum() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
fn main() { | ||
|
||
node_bindgen::build::configure(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
fn main() { | ||
|
||
node_bindgen::build::configure(); | ||
} | ||
} |
Oops, something went wrong.