Skip to content

Commit 301d17b

Browse files
authored
remove usage of metacall::switch and some edits in Rust docs (#573)
* remove usage of metacall::switch and some edits in Rust docs * edit rs_port readme to metacall 4.4 Signed-off-by: fahdfady <fahd.fady212@gmail.com> --------- Signed-off-by: fahdfady <fahd.fady212@gmail.com>
1 parent fce639c commit 301d17b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

source/ports/rs_port/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export function sum(a: number, b: number): number {
2626

2727
`main.rs`
2828
``` rust
29-
use metacall::{switch, metacall, loaders};
29+
use metacall::{initialize, metacall, load};
3030

3131
fn main() {
3232
// Initialize MetaCall at the top
33-
let _metacall = switch::initialize().unwrap();
33+
let _metacall = initialize().unwrap();
3434

3535
// Load the file
3636
load::from_single_file("ts", "sum.ts").unwrap();

source/ports/rs_port/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
//! Now let's jump into Rust:
4242
//!
4343
//! ```
44-
//! use metacall::{switch, metacall, loaders};
44+
//! use metacall::{initialize, metacall, load};
4545
//!
4646
//! fn main() {
4747
//! // Initialize MetaCall at the top
48-
//! let _metacall = switch::initialize().unwrap();
48+
//! let _metacall = initialize().unwrap();
4949
//!
5050
//! // Load the file (Checkout the loaders module for loading multiple files
5151
//! // or loading from string)

0 commit comments

Comments
 (0)