Skip to content

Commit 4278b5e

Browse files
committed
docs: update API examples with new handle parameter
Updated documentation examples for: -from_single_file -from_file -from_memory Added None as handle parameter to match new API signature.
1 parent 6bae6d2 commit 4278b5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/ports/rs_port/src/load.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl Drop for Handle {
100100
/// Loads a file from a single file. Usage example: ...
101101
/// ```
102102
/// // A Nodejs path
103-
/// metacall::load::from_single_file("node", "index.js").unwrap();
103+
/// metacall::load::from_single_file(Tag::NodeJS, "index.js",None).unwrap();
104104
/// ```
105105
pub fn from_single_file(
106106
tag: Tag,
@@ -113,7 +113,7 @@ pub fn from_single_file(
113113
/// Loads a path from file. Usage example: ...
114114
/// ```
115115
/// // A Nodejs script
116-
/// metacall::load::from_file(Tag::NodeJS, ["index.js", "main.js"]).unwrap();
116+
/// metacall::load::from_file(Tag::NodeJS, ["index.js", "main.js"],None).unwrap();
117117
/// ```
118118
pub fn from_file(
119119
tag: Tag,
@@ -167,7 +167,7 @@ pub fn from_file(
167167
/// let script = "function greet() { return 'hi there!' }; module.exports = { greet };";
168168
///
169169
/// // A Nodejs script
170-
/// metacall::load::from_memory(Tag::NodeJS, script).unwrap();
170+
/// metacall::load::from_memory(Tag::NodeJS, script, None).unwrap();
171171
/// ```
172172
pub fn from_memory(
173173
tag: Tag,

0 commit comments

Comments
 (0)